]> git.ozlabs.org Git - ccan/blobdiff - tools/manifest.c
tools: don't assume modules are immediately below ccan/ dir.
[ccan] / tools / manifest.c
index 4cf540bd477bbabdc31e55e22503d1068170285d..cf4c987e956a261ea42772d16e3f1a5faab8d682 100644 (file)
@@ -239,6 +239,7 @@ struct manifest *get_manifest(const void *ctx, const char *dir)
        list_head_init(&m->deps);
        list_head_init(&m->test_deps);
 
+       /* Trim trailing /. */
        len = strlen(m->dir);
        while (len && m->dir[len-1] == '/')
                m->dir[--len] = '\0';
@@ -248,6 +249,9 @@ struct manifest *get_manifest(const void *ctx, const char *dir)
                errx(1, "I don't expect to be run from the root directory");
        m->basename++;
 
+       assert(strstarts(m->dir, find_ccan_dir(m->dir)));
+       m->modname = m->dir + strlen(find_ccan_dir(m->dir)) + strlen("ccan/");
+
        add_files(m, "");
 
        /* Nicer to run tests in a predictable order. */