forked from ariadne/pkgconf
pkg: add pkg_verify_graph() to verify the depgraph is satisfiable
parent
95298b4c72
commit
8100eb84f0
3
main.c
3
main.c
|
@ -101,6 +101,9 @@ pkg_queue_walk(pkg_queue_t *head)
|
|||
world.requires = pkg_dependency_append(world.requires, pkgdep);
|
||||
}
|
||||
|
||||
/* we should verify that the graph is complete before attempting to compute cflags etc. */
|
||||
pkg_verify_graph(&world, maximum_traverse_depth);
|
||||
|
||||
if (want_modversion)
|
||||
{
|
||||
wanted_something = 0;
|
||||
|
|
15
pkg.c
15
pkg.c
|
@ -33,6 +33,18 @@ pkg_find(const char *name)
|
|||
return parse_file(locbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
* pkg_verify_graph(root, depth)
|
||||
*
|
||||
* verify the graph dependency nodes are satisfiable by walking the tree using
|
||||
* pkg_traverse().
|
||||
*/
|
||||
void
|
||||
pkg_verify_graph(pkg_t *root, int depth)
|
||||
{
|
||||
pkg_traverse(root, NULL, NULL, depth);
|
||||
}
|
||||
|
||||
void
|
||||
pkg_traverse(pkg_t *root,
|
||||
void (*pkg_traverse_func)(pkg_t *package, void *data),
|
||||
|
@ -64,5 +76,6 @@ pkg_traverse(pkg_t *root,
|
|||
pkg_traverse(pkgdep, pkg_traverse_func, data, maxdepth - 1);
|
||||
}
|
||||
|
||||
pkg_traverse_func(root, data);
|
||||
if (pkg_traverse_func != NULL)
|
||||
pkg_traverse_func(root, data);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue