From 187b4e538ff167be55103141c25e8948eca8234a Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 2 May 2012 23:14:53 +0000 Subject: [PATCH] pkg: add resolver flags to pkg_find() and pkg_verify_dependency(). --- main.c | 4 ++-- pkg.c | 10 +++++----- pkg.h | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index ee40dc9..5da48a1 100644 --- a/main.c +++ b/main.c @@ -215,7 +215,7 @@ pkg_queue_walk(pkg_queue_t *head) { pkg_t *pkg; - pkg = pkg_verify_dependency(iter); + pkg = pkg_verify_dependency(iter, global_traverse_flags); print_requires(pkg, NULL); } } @@ -362,7 +362,7 @@ main(int argc, char *argv[]) if (package == NULL) return EXIT_SUCCESS; - pkg = pkg_find(package); + pkg = pkg_find(package, global_traverse_flags); if (pkg == NULL) return EXIT_FAILURE; diff --git a/pkg.c b/pkg.c index a5f2edd..bbf8846 100644 --- a/pkg.c +++ b/pkg.c @@ -59,7 +59,7 @@ path_split(const char *text, char ***parv) } pkg_t * -pkg_find(const char *name) +pkg_find(const char *name, unsigned int flags) { char locbuf[PKG_CONFIG_PATH_SZ]; char **path; @@ -233,17 +233,17 @@ pkg_get_comparator(pkg_dependency_t *pkgdep) } /* - * pkg_verify_dependency(pkgdep) + * pkg_verify_dependency(pkgdep, flags) * * verify a pkg_dependency_t node in the depgraph. if the dependency is solvable, * return the appropriate pkg_t object, else NULL. */ pkg_t * -pkg_verify_dependency(pkg_dependency_t *pkgdep) +pkg_verify_dependency(pkg_dependency_t *pkgdep, unsigned int flags) { pkg_t *pkg; - pkg = pkg_find(pkgdep->package); + pkg = pkg_find(pkgdep->package, flags); if (pkg == NULL) return NULL; @@ -312,7 +312,7 @@ pkg_walk_list(pkg_t *parent, if (*node->package == '\0') continue; - pkgdep = pkg_verify_dependency(node); + pkgdep = pkg_verify_dependency(node, flags); if (pkgdep == NULL) { fprintf(stderr, "Package %s was not found in the pkg-config search path.\n", node->package); diff --git a/pkg.h b/pkg.h index 6d9825c..5ea7440 100644 --- a/pkg.h +++ b/pkg.h @@ -103,11 +103,11 @@ struct pkg_ { #define PKGF_NONE 0x0 #define PKGF_SEARCH_PRIVATE 0x1 -pkg_t *pkg_find(const char *name); +pkg_t *pkg_find(const char *name, unsigned int flags); void pkg_traverse(pkg_t *root, void (*pkg_traverse_func)(pkg_t *package, void *data), void *data, int maxdepth, unsigned int flags); void pkg_verify_graph(pkg_t *root, int depth); int pkg_compare_version(const char *a, const char *b); -pkg_t *pkg_verify_dependency(pkg_dependency_t *pkgdep); +pkg_t *pkg_verify_dependency(pkg_dependency_t *pkgdep, unsigned int flags); const char *pkg_get_comparator(pkg_dependency_t *pkgdep); /* parse.c */