summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2005-10-16 17:31:41 +0000
committerTollef Fog Heen <tfheen@err.no>2005-10-16 17:31:41 +0000
commitec5f06d60f5e7dd4b9bf42ccae298d3e42b7ef18 (patch)
tree6c263afd4e0eddbf3013c8dd2044a7133c379f1e
parent7f9c9a4ff0eca8d704dac4b93cbf641c7c5636ed (diff)
downloadpkg-config-ec5f06d60f5e7dd4b9bf42ccae298d3e42b7ef18.tar.gz
Add --short-errors
2005-10-16 Tollef Fog Heen <tfheen@err.no> * 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.
-rw-r--r--ChangeLog10
-rw-r--r--main.c8
-rw-r--r--pkg.c6
-rw-r--r--pkg.h1
4 files changed, 24 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f0b42fd..ed12518 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2005-10-16 Tollef Fog Heen <tfheen@err.no>
+
+ * 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 <tfheen@err.no>
* 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);