ccanlint: Add -k option to keep results.
[ccan] / tools / ccanlint / compulsory_tests / check_depends_exist.c
index aef2a24baeb3e0a57a759cb757da79e9bd55a9f0..7cdb49f5336a3426cd40adbb8441c191347232e0 100644 (file)
 
 static char *add_dep(char *sofar, struct manifest *m, const char *dep)
 {
 
 static char *add_dep(char *sofar, struct manifest *m, const char *dep)
 {
-       char *dir;
        struct stat st;
        struct ccan_file *f;
 
        struct stat st;
        struct ccan_file *f;
 
-       dir = talloc_asprintf(m, "%s/%s", ccan_dir, dep);
-       if (stat(dir, &st) != 0) {
+       f = new_ccan_file(m, ccan_dir, talloc_strdup(m, dep));
+       if (stat(f->fullname, &st) != 0) {
                return talloc_asprintf_append(sofar,
                                              "ccan/%s: expected it in"
                                              " directory %s\n",
                return talloc_asprintf_append(sofar,
                                              "ccan/%s: expected it in"
                                              " directory %s\n",
-                                             dep, dir);
+                                             dep, f->fullname);
        }
 
        }
 
-       f = new_ccan_file(m, "", dir);
        list_add_tail(&m->dep_dirs, &f->list);
        return sofar;
 }
 
        list_add_tail(&m->dep_dirs, &f->list);
        return sofar;
 }
 
-static void *check_depends_exist(struct manifest *m)
+static void *check_depends_exist(struct manifest *m,
+                                bool keep,
+                                unsigned int *timeleft)
 {
        unsigned int i;
        char *report = NULL;
 {
        unsigned int i;
        char *report = NULL;