X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=tools%2Fccanlint%2Ftests%2Fdepends_exist.c;h=09c187e98f54ccefb01c6072be479fce72784d93;hb=6aa2f4e347e5d66a392b879fe901bc582099a552;hp=c63d2d2c84d6d85baafdd953a2279bd671199b29;hpb=dc8042b42500f79f613b1197df6cdf739615a89f;p=ccan diff --git a/tools/ccanlint/tests/depends_exist.c b/tools/ccanlint/tests/depends_exist.c index c63d2d2c..09c187e9 100644 --- a/tools/ccanlint/tests/depends_exist.c +++ b/tools/ccanlint/tests/depends_exist.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,7 @@ static bool add_dep(struct manifest *m, { struct stat st; struct manifest *subm; - char *dir = tal_fmt(m, "%s/%s", ccan_dir, dep); + char *dir = path_join(m, ccan_dir, dep); /* FIXME: get_manifest has a tendency to exit. */ if (stat(dir, &st) != 0) { @@ -56,9 +57,16 @@ static void check_depends_exist(struct manifest *m, deps = get_deps(m, m->dir, "depends", true, get_or_compile_info); + if (!deps) { + score->error = tal_fmt(m, "Could not extract dependencies"); + return; + } + for (i = 0; deps[i]; i++) { - if (!strstarts(deps[i], "ccan/")) + if (!strstarts(deps[i], "ccan/")) { + non_ccan_deps = true; continue; + } if (!add_dep(m, &m->deps, deps[i], score)) return;