X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fmanifest.c;h=b4db234f67501bf72525dec54aa549c8218c66d2;hb=aabf300e324f7da5134d7ad45afba11225045c24;hp=e368b4ed1e2a8b0470218cc30a42aa7f5da3547d;hpb=453fdc02ce54ff965f9971a3bfd0e1a79b6c98f9;p=ccan diff --git a/tools/manifest.c b/tools/manifest.c index e368b4ed..b4db234f 100644 --- a/tools/manifest.c +++ b/tools/manifest.c @@ -7,16 +7,15 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -45,7 +44,8 @@ static struct htable_manifest *manifests; const char *get_ccan_file_contents(struct ccan_file *f) { if (!f->contents) { - f->contents = grab_file(f, f->fullname, &f->contents_size); + f->contents = talloc_grab_file(f, f->fullname, + &f->contents_size); if (!f->contents) err(1, "Reading file %s", f->fullname); } @@ -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. */