]> git.ozlabs.org Git - ccan/blobdiff - tools/ccanlint/tests/depends_exist.c
ccanlint: fix --compiler and --cflags options to apply to _info files as well.
[ccan] / tools / ccanlint / tests / depends_exist.c
index 76750fb1236f7bab79e7ff2a73412aa74185d919..39015fd58730d9184edc0a295ab127a34005530c 100644 (file)
@@ -1,7 +1,7 @@
 #include <tools/ccanlint/ccanlint.h>
 #include <tools/tools.h>
-#include <ccan/talloc/talloc.h>
 #include <ccan/str/str.h>
+#include <ccan/tal/path/path.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -19,7 +19,7 @@ static bool have_dep(struct manifest *m, const char *dep)
        struct manifest *i;
 
        list_for_each(&m->deps, i, list)
-               if (streq(i->basename, dep + strlen("ccan/")))
+               if (streq(i->modname, dep + strlen("ccan/")))
                        return true;
 
        return false;
@@ -31,14 +31,12 @@ static bool add_dep(struct manifest *m,
 {
        struct stat st;
        struct manifest *subm;
-       char *dir = talloc_asprintf(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) {
-               score->error
-                       = talloc_asprintf(m,
-                                         "Could not stat dependency %s: %s",
-                                         dir, strerror(errno));
+               score->error = tal_fmt(m, "Could not stat dependency %s: %s",
+                                      dir, strerror(errno));
                return false;
        }
        subm = get_manifest(m, dir);
@@ -80,7 +78,7 @@ static void check_test_depends_exist(struct manifest *m,
        bool needs_tap;
 
        /* We may need libtap for testing, unless we're "tap" */
-       if (streq(m->basename, "tap")) {
+       if (streq(m->modname, "tap")) {
                needs_tap = false;
        } else if (list_empty(&m->run_tests) && list_empty(&m->api_tests)) {
                needs_tap = false;