Enable Requires and Requires.private for --exists

Prior to pkg-config 0.24, --exists honored Requires and
Requires.private. This was regressed in commits 02d5ae3f and 669bfe2e,
which split the handling of Requires and Requires.private out more
correctly for other options. This adds exists to the group of options
that enable the Requires functionality.

Freedesktop #43149
This commit is contained in:
Dan Nicholson 2012-06-07 05:51:59 -07:00
parent a077e02430
commit 3ead3dfb78
2 changed files with 6 additions and 5 deletions

View file

@ -14,16 +14,16 @@ ARGS="--exists pkg-non-existent"
run_test
# existing package, but with missing Requires
EXPECT_RETURN=0
EXPECT_RETURN=1
RESULT=""
ARGS="--exists missing-requires"
run_test
# tests below are on an existing package, but with missing Requires.private;
# when pkg-config outputs error, the actual error text isn't checked
# package exists
# package exists, but should fail since deps can't be resolved
ARGS="--exists missing-requires-private"
EXPECT_RETURN=0
EXPECT_RETURN=1
RESULT=""
run_test

5
main.c
View file

@ -424,14 +424,15 @@ main (int argc, char **argv)
* libs are requested */
if (want_I_cflags || want_other_cflags || want_cflags ||
want_requires_private ||
want_requires_private || want_exists ||
(want_static_lib_list && (want_libs || want_l_libs || want_L_libs)))
enable_requires_private();
/* ignore Requires if no Cflags or Libs are requested */
if (!want_I_cflags && !want_other_cflags && !want_cflags &&
!want_libs && !want_l_libs && !want_L_libs && !want_requires)
!want_libs && !want_l_libs && !want_L_libs && !want_requires &&
!want_exists)
disable_requires();
if (want_my_version)