=== modified file 'ChangeLog' --- old/ChangeLog 2007-06-19 13:58:48 +0000 +++ new/ChangeLog 2007-10-19 19:30:35 +0000 @@ -1,3 +1,23 @@ +2007-10-19 Dan Nicholson + + * pkg.c: Allow ignore_requires boolean to be toggled like + ignore_private_libs. + (enable_requires): New function to set ignore_requires to FALSE. + (disable_requires): New function to set ignore_requires to TRUE. + + * pkg.h: Prototypes for enable_requires() and disable_requires(). + + * parse.c: When ignore_requires is TRUE, skip parsing of both + the Requires and Requires.private field. Remove the goto handling + from the Requires case since it will be reached next, anyway. + + * main.c: Call disable_requires() when just checking package + existence. This allows `pkg-config --exists' to return successfully + when a required package is missing. Fixes Freedesktop #4738. + + * check/check-requires-private: Fix the Requires.private test to + check that the Cflags are added correctly. + 2007-06-19 Tollef Fog Heen * pkg.m4: Fix bug so it's possible to override variables in case === modified file 'check/check-requires-private' --- old/check/check-requires-private 2005-08-22 10:41:08 +0000 +++ new/check/check-requires-private 2007-10-19 19:16:49 +0000 @@ -11,12 +11,12 @@ # expect cflags from requires-test and public-dep ARGS="--cflags requires-test" -RESULT="-I/requires-test/include -I/public-dep/include" +RESULT="-I/requires-test/include -I/private-dep/include -I/public-dep/include" run_test # still expect those cflags for static linking case ARGS="--static --cflags requires-test" -RESULT="-I/requires-test/include -I/public-dep/include" +RESULT="-I/requires-test/include -I/private-dep/include -I/public-dep/include" run_test # expect libs for just requires-test and public-dep === modified file 'main.c' --- old/main.c 2006-08-16 17:57:14 +0000 +++ new/main.c 2007-10-19 19:10:32 +0000 @@ -420,6 +420,11 @@ else disable_private_libs(); + if (want_exists) + disable_requires(); + else + enable_requires(); + if (want_my_version) { printf ("%s\n", VERSION); === modified file 'parse.c' --- old/parse.c 2007-05-30 11:24:42 +0000 +++ new/parse.c 2007-10-19 19:12:43 +0000 @@ -956,15 +956,12 @@ parse_description (pkg, p, path); else if (strcmp (tag, "Version") == 0) parse_version (pkg, p, path); - else if (strcmp (tag, "Requires.private") == 0) - parse_requires_private (pkg, p, path); - else if (strcmp (tag, "Requires") == 0) - { - if (ignore_requires == FALSE) - parse_requires (pkg, p, path); - else - goto cleanup; - } + else if ((strcmp (tag, "Requires.private") == 0) && + ignore_requires == FALSE) + parse_requires_private (pkg, p, path); + else if ((strcmp (tag, "Requires") == 0) && + ignore_requires == FALSE) + parse_requires (pkg, p, path); else if ((strcmp (tag, "Libs.private") == 0) && ignore_private_libs == FALSE) parse_libs_private (pkg, p, path); === modified file 'pkg.c' --- old/pkg.c 2007-06-18 21:19:27 +0000 +++ new/pkg.c 2007-10-19 19:10:32 +0000 @@ -1519,3 +1519,15 @@ { ignore_private_libs = TRUE; } + +void +enable_requires(void) +{ + ignore_requires = FALSE; +} + +void +disable_requires(void) +{ + ignore_requires = TRUE; +} === modified file 'pkg.h' --- old/pkg.h 2005-10-16 17:31:41 +0000 +++ new/pkg.h 2007-10-19 19:10:32 +0000 @@ -120,6 +120,9 @@ void enable_private_libs(void); void disable_private_libs(void); +void enable_requires(void); +void disable_requires(void); + /* If TRUE, do not automatically prefer uninstalled versions */ extern gboolean disable_uninstalled;