From b0b73149f816619a5a354eaf4eac9271cba78f0f Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 21 May 2015 23:20:40 -0500 Subject: [PATCH] main: implement --validate as in pkg-config 0.29 git --- main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.c b/main.c index 6e2ce2a..348e3c3 100644 --- a/main.c +++ b/main.c @@ -46,6 +46,7 @@ #define PKG_SIMULATE (1<<27) #define PKG_NO_CACHE (1<<28) #define PKG_PROVIDES (1<<29) +#define PKG_VALIDATE (1<<30) static unsigned int global_traverse_flags = PKGF_NONE; @@ -538,6 +539,7 @@ usage(void) printf(" (for static linking)\n"); printf(" --env-only look only for package entries in PKG_CONFIG_PATH\n"); printf(" --ignore-conflicts ignore 'conflicts' rules in modules\n"); + printf(" --validate validate specific .pc files for correctness\n"); printf("\nquerying specific pkg-config database fields:\n\n"); @@ -614,6 +616,7 @@ main(int argc, char *argv[]) { "no-cache", no_argument, &want_flags, PKG_NO_CACHE, }, { "print-provides", no_argument, &want_flags, PKG_PROVIDES, }, { "debug", no_argument, &want_flags, 0, }, + { "validate", no_argument, NULL, 0 }, { NULL, 0, NULL, 0 } }; @@ -869,6 +872,9 @@ main(int argc, char *argv[]) goto out; } + if ((want_flags & PKG_VALIDATE) == PKG_VALIDATE) + return 0; + if ((want_flags & PKG_UNINSTALLED) == PKG_UNINSTALLED) { ret = EXIT_FAILURE;