pkg-config 0.23 exits immediately when encountering a parse error in trim_and_sub(), e.g. if a .pc files misses a required variable. When using --list-all this is quite unfortunate, since the advertised use of --list-all is to list all installed packages, not only those before a bad package file is encountered. This is a problem at least for ruby-gnome2 which wraps pkg-config in a ruby interface, using pkg-config with the --list-all option to learn about installed packages. A good solution would be to write out an error to STDERR and not include the broken package in the output list of --list-all.
*** Bug 28609 has been marked as a duplicate of this bug. ***
Still present in at least 0.26
Fixed in 715cc30.
For the mentioned previous bug report there is a closing comment that commit 715cc30 fixes it, but when I checked the commit the parser exists as before in case of some heavier error in .pc file during '--list-all' command execution. Tests results of pkg-configs with simulated error (.pc without Name: tag): [commit 715cc30:] ./pkg-config --list-all | wc -l (pkg-config:9743): GLib-CRITICAL **: g_string_append: assertion 'val != NULL' failed 449 [patched 0.28 with my patch applied:] trevor@trevhomepc:/usr/local/src/pkg-config/pkg-config> pkg-config --list-all | wc -l Variable 'libjpeg_prefix' not defined in '/usr/lib/pkgconfig/libgdiplus.pc' Package 'gnome-icon-theme' has no Name: field 720 When the commit 715cc30 fixes something, it doesn't solve all problems with incorrectly prepared .pc files in pkg-config database in scope of '--list-all' command, regards, T.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.