diff --git a/pkg.c b/pkg.c index 5418450..92658e9 100644 --- a/pkg.c +++ b/pkg.c @@ -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]); diff --git a/pkg.h b/pkg.h index 6552b7c..1163dc4 100644 --- a/pkg.h +++ b/pkg.h @@ -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;