[sos-devel] Sosreport sorts packages with -f and that might not show latest line with latest installed package

Pablo Iranzo Gómez Pablo.Iranzo at redhat.com
Wed Jan 10 15:54:25 UTC 2018


Hi,
This comes out of https://github.com/sosreport/sos/issues/1184

Where, the use of sort -f does mess with the rpm ordering not showing
latest or first the higher package version.

It does seem that sort -V does this:

Fake entry

[piranzo at collab-shell ~]$ echo "kernel-3.9.0-001.1.12.el7.x86_64" >> installed-rpms 

Show entry faked:

[piranzo at collab-shell ~]$ grep kernel installed-rpms 
kernel-3.10.0-514.16.1.el7.x86_64                           Thu May  4 17:11:30 2017
kernel-3.10.0-693.11.6.el7.x86_64                           Tue Jan  9 12:26:12 2018
kernel-3.10.0-693.2.2.el7.x86_64                            Wed Sep 20 17:32:23 2017
kernel-3.9.0-001.1.12.el7.x86_64

Entry was at the end, now let's try sort -V:

[piranzo at collab-shell ~]$ grep kernel installed-rpms |sort -V
kernel-3.9.0-001.1.12.el7.x86_64
kernel-3.10.0-514.16.1.el7.x86_64                           Thu May  4 17:11:30 2017
kernel-3.10.0-693.2.2.el7.x86_64                            Wed Sep 20 17:32:23 2017
kernel-3.10.0-693.11.6.el7.x86_64                           Tue Jan  9 12:26:12 2018


What are your toughs on this?

Even if we've several sos report versions hanging around with the 'unnatural' sorting, it still be good in the future to have this as default to quickly check the installed rpm's ordered (request that introduced the sort -f, to visually check package versions for the same package alongside), and also, allow to check last line for latest version.


Thanks,
Pablo

-- 

Pablo Iranzo Gómez (Pablo.Iranzo at redhat.com)          GnuPG: 0x5BD8E1E4
Senior Software Maintenance Engineer - OpenStack           iranzo @ IRC
RHC{A,SS,DS,VA,E,SA,SP,AOSP}, JBCAA  #110-215-852
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/sos-devel/attachments/20180110/babbaa37/attachment.sig>


More information about the sos-devel mailing list