Bug 26615 - pkg-config 0.23 should not exit on parse errors when using --list-all
Summary: pkg-config 0.23 should not exit on parse errors when using --list-all
Status: RESOLVED FIXED
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Tollef Fog Heen
QA Contact:
URL: https://bugs.gentoo.org/show_bug.cgi?...
Whiteboard:
Keywords:
: 28609 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-02-17 12:29 UTC by Hans de Graaff
Modified: 2014-06-18 09:21 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Hans de Graaff 2010-02-17 12:29:42 UTC
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.
Comment 1 Rodrigo Silva 2013-05-09 13:46:32 UTC
*** Bug 28609 has been marked as a duplicate of this bug. ***
Comment 2 Rodrigo Silva 2013-05-09 13:51:18 UTC
Still present in at least 0.26
Comment 3 Dan Nicholson 2013-05-17 12:56:43 UTC
Fixed in 715cc30.
Comment 4 Tadeusz Szczyrba 2014-06-18 09:21:24 UTC
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.