Bug 79689 - Order of --list-all output
Summary: Order of --list-all output
Alias: None
Product: pkg-config
Classification: Unclassified
Component: src (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Dan Nicholson
QA Contact:
Depends on:
Reported: 2014-06-05 16:33 UTC by Daniel Macks
Modified: 2018-08-25 12:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:

Alphabetical sort of --list-all output (1.26 KB, text/plain)
2014-06-05 16:33 UTC, Daniel Macks
Alphabetical sort of --list-all output (2.21 KB, patch)
2017-12-16 08:11 UTC, Daniel Macks
Details | Splinter Review

Description Daniel Macks 2014-06-05 16:33:09 UTC
Created attachment 100474 [details]
Alphabetical sort of --list-all output

For the same reason as Bug #79666 (but not caught by a test-case), the order of packages displayed the --list-all mode is non-deterministic. The attached patch makes it alphabetical.
Comment 1 Dan Nicholson 2014-09-27 22:54:08 UTC
As in bug79666, wouldn't it be more deterministic to use strcmp?
Comment 2 Daniel Macks 2017-12-16 08:07:48 UTC
Commit 715cc306b0e4add06523b8fcce49867da469a728 demonstrates the oddity of unsorted output. Given ghash's hashing method and how few items there are, it doesn't fail. But the success technically does appear to require that the hash-order is deterministic. And the expected results--packages ordered as:


from --list-all demonstrates that how it is unfriendly to humans trying to read the list to find packages in it by eye.
Comment 3 Daniel Macks 2017-12-16 08:11:49 UTC
Created attachment 136212 [details] [review]
Alphabetical sort of --list-all output

Updated to patch against 0.29.2 and with g_strcmp0 as in 818aeace3b08d731d104d5ef9b1d5e3c34dd4192 (the committed seeming resolution of Bug #79666). Updated test-case, and with more uniform coding style.
Comment 4 GitLab Migration User 2018-08-25 12:54:13 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/21.

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.