From: Tollef Fog Heen Date: Sun, 16 Oct 2005 17:31:41 +0000 (+0000) Subject: Add --short-errors X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec5f06d60f5e7dd4b9bf42ccae298d3e42b7ef18;p=pkg-config Add --short-errors 2005-10-16 Tollef Fog Heen * pkg.c (get_package_quiet): Add get_package_quiet which is just the same as get_package except it sets warn to false. * pkg.h: Add prototype for get_package_quiet. * main.c (main): Add --short-errors flag to suppress most of the output when a module is not found. --- diff --git a/ChangeLog b/ChangeLog index f0b42fd..ed12518 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-10-16 Tollef Fog Heen + + * pkg.c (get_package_quiet): Add get_package_quiet which is just + the same as get_package except it sets warn to false. + + * pkg.h: Add prototype for get_package_quiet. + + * main.c (main): Add --short-errors flag to suppress most of the + output when a module is not found. + 2005-10-01 Tollef Fog Heen * pkg.c (packages_get_var): Don't try to chop if string length is diff --git a/main.c b/main.c index 199fd0c..2d31d15 100644 --- a/main.c +++ b/main.c @@ -183,6 +183,7 @@ main (int argc, char **argv) int want_other_cflags = 0; int want_list = 0; int want_static_lib_list = ENABLE_INDIRECT_DEPS; + int want_short_errors = 0; int result; int want_uninstalled = 0; char *variable_name = NULL; @@ -218,6 +219,8 @@ main (int argc, char **argv) "output all linker flags" }, { "static", 0, POPT_ARG_NONE, &want_static_lib_list, 0, "output linker flags for static linking" }, + { "short-errors", 0, POPT_ARG_NONE, &want_short_errors, 0, + "print short errors" }, { "libs-only-l", 0, POPT_ARG_NONE, &want_l_libs, 0, "output -l flags" }, { "libs-only-other", 0, POPT_ARG_NONE, &want_other_libs, 0, @@ -469,7 +472,10 @@ main (int argc, char **argv) Package *req; RequiredVersion *ver = iter->data; - req = get_package (ver->name); + if (want_short_errors) + req = get_package_quiet (ver->name); + else + req = get_package (ver->name); if (req == NULL) { diff --git a/pkg.c b/pkg.c index 84f710e..e200a52 100644 --- a/pkg.c +++ b/pkg.c @@ -387,6 +387,12 @@ get_package (const char *name) return internal_get_package (name, TRUE, TRUE); } +Package * +get_package_quiet (const char *name) +{ + return internal_get_package (name, FALSE, TRUE); +} + static GSList* string_list_strip_duplicates (GSList *list) { diff --git a/pkg.h b/pkg.h index 67e9a84..8043205 100644 --- a/pkg.h +++ b/pkg.h @@ -78,6 +78,7 @@ struct _Package }; Package *get_package (const char *name); +Package *get_package_quiet (const char *name); char * package_get_l_libs (Package *pkg); char * packages_get_l_libs (GSList *pkgs); char * package_get_L_libs (Package *pkg);