+ char **libs, *cmd;
+
+ if (!*infofile) {
+ *infofile = compile_info(ctx, dir);
+ if (!*infofile)
+ errx(1, "Could not compile _info for '%s'", dir);
+ }
+
+ cmd = talloc_asprintf(ctx, "%s libs", *infofile);
+ libs = lines_from_cmd(cmd, num, "%s", cmd);
+ if (!libs)
+ err(1, "Could not run '%s'", cmd);
+ return libs;
+}
+
+char **get_deps(const void *ctx, const char *dir,
+ bool recurse, char **infofile)
+{
+ char *temp = NULL, **ret;
+ if (!infofile)
+ infofile = &temp;
+
+ if (!recurse) {
+ unsigned int num;
+ ret = get_one_deps(ctx, dir, &num, infofile);
+ } else
+ ret = get_all_deps(ctx, dir, infofile, get_one_deps);
+
+ if (infofile == &temp && temp) {
+ unlink(temp);
+ talloc_free(temp);
+ }
+ return ret;