-----Original Message----- From: Denniston, Todd A CIV NAVSURFWARCENDIV Crane Sent: Wednesday, November 16, 2011 16:37 To: CentOS mailing list Subject: RE: [CentOS] How can rpm "%{SUMMARY}" not be consistent?
-----Original Message----- From: centos-bounces@centos.org [mailto:centos-bounces@centos.org]
On
Behalf Of Akemi Yagi Sent: Wednesday, November 16, 2011 11:20 To: CentOS mailing list Subject: Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?
On Wed, Nov 16, 2011 at 6:56 AM, John Hodrien
wrote:
On Wed, 16 Nov 2011, Akemi Yagi wrote:
What you are seeing is indeed odd. I see 'version 3.1' but not
'3.2'
anywhere on the Summary line of bash.
I would have said you also seeing 'version 3.1.' is one of the very
odd
things, but then I check the bash rpm in a repo and it has 'version 3.1.' in the 3.2-32.el5 rpm.
I think I know some of what is causing what is going on now... After a little testing with a format string of
'"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","% {INSTALLTIME:date}"\n' I found I got different results based on the LANG environment setting, which led me to try it with the SUMMARY field too.
###start with a normally configured terminal $ cd /to/your/CentOS/mirror/ $ locale |grep LANG LANG=en_US.UTF-8 $ rpm -q \ --qf '"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","% {SUMMARY}"\n' \ -p 5.7/os/i386/CentOS/bash-3.2-32.el5.i386.rpm "CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again shell (bash) version 3.1."
#now change LANG to what I see from cron $ export LANG= $ locale |grep LANG LANG= $ rpm -q \ --qf '"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","% {SUMMARY}"\n' \ -p 5.7/os/i386/CentOS/bash-3.2-32.el5.i386.rpm "CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again shell (bash) version 3.2"
Why does a number in a text string change based on LANG?
####and for added fun... look at an agg package from epel $ export LANG=en_US.UTF-8 $ rpm -q --qf '"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","% {SUMMARY}"\n' agg "Fedora Project","agg","2.5","2.5-9.el5","i386","Anti-Grain Geometry" $ export LANG= $ rpm -q --qf '"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","% {SUMMARY}"\n' agg "Fedora Project","agg","2.5","2.5-9.el5","i386","Anti-Grain Geometry graphical rendering engine"
Why does the string length change this dramatically based on LANG?
Well I guess I at least know what I need to do to the script to have it be consistent.
I might even get around to filing a RH bug, because this does not seem to me to be a correct behavior to me. does anyone here see these changes as correct behavior (and why)?