+ if (!manifests)
+ manifests = htable_manifest_new();
+
+ olddir = talloc_getcwd(NULL);
+ if (!olddir)
+ err(1, "Getting current directory");
+
+ if (chdir(dir) != 0)
+ err(1, "Failed to chdir to %s", dir);
+
+ canon_dir = talloc_getcwd(olddir);
+ if (!canon_dir)
+ err(1, "Getting current directory");
+
+ m = htable_manifest_get(manifests, canon_dir);
+ if (m)
+ goto done;
+
+ m = talloc_linked(ctx, talloc(NULL, struct manifest));