From d6a14488dbc9e65bbd52a2ec26ba175fa7ee6064 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 30 Oct 2012 17:34:20 -0700 Subject: [PATCH] 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) --- main.c | 31 +++++++++++++++---------------- 1 file 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 */