Bug 1094065

Summary: [PATCH] --last option does not sort correctly with some non-en locales
Product: [Fedora] Fedora Reporter: larchunix
Component: rpmAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: ffesti, jzeleny, novyjindrich, packaging-team-maint, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-27 09:01:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix rpm --last sorting with some non-en locales none

Description larchunix 2014-05-04 21:25:58 UTC
Created attachment 892339 [details]
Fix rpm --last sorting with some non-en locales

The attached (oneliner) patch fix the following issue:

On some locales (e.g: french), sort interprets the space character as a
thousands separator. As a result, digit(s) at the beginning of package
names (e.g: '0' for 0ad), are merged with package installation
timestamp and the output of rpm -qa --last is wrong.

For instance, the following list:

    1398777401 0ad-0.0.15-3.fc20.x86_64
    1397901236 kernel-3.13.10-200.fc20.x86_64
    1399198174 kernel-3.14.2-200.fc20.x86_64

is sorted like this:

    1398777401 0ad-0.0.15-3.fc20.x86_64
    1399198174 kernel-3.14.2-200.fc20.x86_64
    1397901236 kernel-3.13.10-200.fc20.x86_64

instead of:

    1399198174 kernel-3.14.2-200.fc20.x86_64
    1398777401 0ad-0.0.15-3.fc20.x86_64
    1397901236 kernel-3.13.10-200.fc20.x86_64

This patch ensures that the space character is not interpreted as a
thousands separator anymore by setting the environment variable
LC_NUMERIC to C locale for numeric sorts.

Comment 1 Jaroslav Reznik 2015-03-03 15:45:41 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle.
Changing version to '22'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22

Comment 2 Florian Festi 2015-03-27 09:01:15 UTC
Added upstream as 55735113178642ab4bcbd75c1adf7d7f9fc65894. Thanks for the patch! Sorry for the delay!