main: --simulate: print bytecode program as a human-readable AST parsable by mowgli.config_parse

pull/48/head
William Pitcock 2013-03-15 19:36:37 -05:00
parent 8980ae5f76
commit d7643ed2b6
1 changed files with 21 additions and 4 deletions

25
main.c
View File

@ -412,13 +412,30 @@ print_graph_node(pkg_t *pkg, void *data, unsigned int flags)
(void) data; (void) data;
(void) flags; (void) flags;
printf("Considering graph node '%s' (%p)\n", pkg->id, pkg); printf("node '%s'", pkg->id);
if (pkg->requires.head != NULL)
printf(" {\n");
else
printf(";\n");
PKG_FOREACH_LIST_ENTRY(pkg->requires.head, n) PKG_FOREACH_LIST_ENTRY(pkg->requires.head, n)
{ {
pkg_dependency_t *dep = n->data; pkg_dependency_t *dep = n->data;
printf(" Dependency '%s' %s '%s' (%p)\n", dep->package, printf(" dependency '%s'", dep->package);
pkg_get_comparator(dep), dep->version != NULL ? dep->version : "*", dep); if (dep->compare != PKG_ANY)
} {
printf(" {\n");
printf(" comparator = '%s';\n", pkg_get_comparator(dep));
printf(" version = '%s';\n", dep->version);
printf(" };\n");
}
else
printf(";\n");
}
if (pkg->requires.head != NULL)
printf("};\n");
} }
static bool static bool