From ec11c93ef843c30d93d182ca940b78a052d0560c Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 11 Dec 2012 10:04:21 -0800 Subject: [PATCH] Explicitly set --exists as the default option This happened basically by accident before when "pkg-config foo" was run because the code wouldn't find any options set and just fall through to the end after processing the package arguments. However, it would act differently in that Requires.private was only enabled with an explicit --exists. --- check/check-missing | 6 +++--- main.c | 7 +++++++ pkg-config.1 | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/check/check-missing b/check/check-missing index 719998a..bb5f79a 100755 --- a/check/check-missing +++ b/check/check-missing @@ -51,10 +51,10 @@ EXPECT_RETURN=0 RESULT="/usr/include/somedir" run_test --variable includedir missing-requires-private -# tests below are on an existing package, but with missing Requires; when -# pkg-config outputs error, the actual error text isn't checked +# tests below are on an existing package, but with missing Requires; +# when pkg-config outputs error, the actual error text isn't checked # package exists -EXPECT_RETURN=0 +EXPECT_RETURN=1 RESULT="" run_test missing-requires diff --git a/main.c b/main.c index 3c13f8e..e0e0e57 100644 --- a/main.c +++ b/main.c @@ -529,6 +529,13 @@ main (int argc, char **argv) return 1; } + /* If no output option was set, then --exists is the default. */ + if (!output_opt_set) + { + debug_spew ("no output option set, defaulting to --exists\n"); + want_exists = TRUE; + } + /* Error printing is determined as follows: * - for --cflags, --libs, etc. it's on by default * and --silence-errors can turn it off diff --git a/pkg-config.1 b/pkg-config.1 index e91a949..530ddb2 100644 --- a/pkg-config.1 +++ b/pkg-config.1 @@ -193,7 +193,8 @@ constraint after each package name, for example: .nf $ pkg-config --exists 'glib-2.0 >= 1.3.4 libxml = 1.8.3' .fi -Remember to use \-\-print-errors if you want error messages. +Remember to use \-\-print-errors if you want error messages. When no +output options are supplied to \fIpkg-config\fP, \-\-exists is implied. .TP .I "--msvc-syntax" This option is available only on Windows. It causes \fIpkg-config\fP