summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2012-10-30 17:34:20 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-10-30 17:54:55 -0700
commitd6a14488dbc9e65bbd52a2ec26ba175fa7ee6064 (patch)
tree39f8185c3d1577ec1239d94aec40c2abd9c47007
parent90e0ec0f6f0fb4bb507a638e03a174cf87353398 (diff)
downloadpkg-config-d6a14488dbc9e65bbd52a2ec26ba175fa7ee6064.tar.gz
Move --print-variables handling after --exists for consistency
The --print-variables output is inconsistent with other printing options when --exists is supplied or not. Move the handling after --exists like --print-requires and others requiring a valid package list so that --exists is given it takes priority and exits early. Freedesktop #54384 (https://bugs.freedesktop.org/show_bug.cgi?id=54384)
-rw-r--r--main.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/main.c b/main.c
index 2aea422..99cb51e 100644
--- a/main.c
+++ b/main.c
@@ -572,6 +572,21 @@ main (int argc, char **argv)
if (failed) {
return 1;
}
+ }
+
+ g_string_free (str, TRUE);
+
+ packages = g_slist_reverse (packages);
+
+ if (packages == NULL)
+ {
+ fprintf (stderr, "Must specify package names on the command line\n");
+
+ exit (1);
+ }
+
+ if (want_exists)
+ return 0; /* if we got here, all the packages existed. */
if (want_variable_list)
{
@@ -590,22 +605,6 @@ main (int argc, char **argv)
need_newline = FALSE;
}
- }
-
- g_string_free (str, TRUE);
-
- packages = g_slist_reverse (packages);
-
- if (packages == NULL)
- {
- fprintf (stderr, "Must specify package names on the command line\n");
-
- exit (1);
- }
-
- if (want_exists)
- return 0; /* if we got here, all the packages existed. */
-
if (want_uninstalled)
{
/* See if > 0 pkgs (including dependencies recursively) were uninstalled */