pkgconf stub: walk the dependency tree

pull/1/merge
William Pitcock 2011-07-24 23:20:22 -05:00
parent c6197b39ac
commit 3f9cedf532
2 changed files with 20 additions and 2 deletions

20
pkg.c
View File

@ -39,7 +39,25 @@ int main(int argc, const char *argv[])
pkg = pkg_find(argv[1]);
if (pkg)
printf("%s %s\n", pkg->cflags, pkg->libs);
{
pkg_dependency_t *node;
foreach_list_entry(pkg->requires, node)
{
pkg_t *pkgdep;
pkgdep = pkg_find(node->package);
if (pkgdep == NULL)
{
printf("dependency '%s' not satisfied\n", node->package);
return -1;
}
printf("%s: {%s} {%s}\n", pkgdep->realname, pkgdep->cflags, pkgdep->libs);
}
printf("%s: {%s} {%s}\n", pkg->realname, pkg->cflags, pkg->libs);
}
else
{
printf("%s not found\n", argv[1]);

2
pkg.h
View File

@ -56,7 +56,7 @@ typedef struct tuple_ pkg_tuple_t;
struct dependency_ {
struct dependency_ *prev, *next;
char *name;
char *package;
pkg_comparator_t compare;
char *version;
pkg_t *parent;