Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-15 Thread Phoenix, Merka
-Original Message-
> Denniston, Todd A CIV NAVSURFWARCENDIV  Crane wrote:
> Sent: Tuesday, 15 November, 2011 12:57
> To: CentOS@centos.org
> Subject: [CentOS] How can rpm "%{SUMMARY}" not be consistent?
> 
> I have been seeing something for quite some time which has confused me
> considerably for over a year, perhaps one of you can help me understand.
> 
> Assumed: rpm queries are against _a_ database.
> Assumed: database queries against the same database, without changes to
> the data in the database, will return the same data.
> 
> Confusion: then why are some of the summaries reported by rpm different?
> 
> Each day I (cron.daily) run the following command
> rpm -qa \
>  --qf
> '"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","%{SUMMARY}"\n'
>  \
>   | sort -t\" -k3 > ${OUTFILE}
> 
> Stuff the resulting ${OUTFILE} in an rcs file.
> 
> And some days the rcs file will show deltas such as the following (which
> was pulled from a rather recent set of flipflops):
> 
> --- mach.csv2011/11/15 10:50:04 
> +++ mach.csv2011/11/15 09:22:53 
> 
> -"CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again shell
> (bash) version 3.1."
> +"CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again shell
> (bash) version 3.2"


Using the double quote (") as a delimiter, the third key would be a comma (,) 
(see below for an example)

 "A","B","C","D","E",...
1"2"3"4"5"6"7"8"9"A"B...

And since your sort command is sorting only on the fifth key, all the commas 
are already in order (unless there is a blank line in there somewhere). The 
order of the re cords within a sorted group may or may not be guaranteed to 
change.

Change your sort order from '-k3' to '-k2 -k4 -k6 -k8 -k10 -k12' to sort by 
Vendor, Name, Version, Version-Release, Arch, Summary and see if that helps.

Cheers!

Simba
Engineering



___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-16 Thread Denniston, Todd A CIV NAVSURFWARCENDIV Crane


> -Original Message-
> From: centos-boun...@centos.org [mailto:centos-boun...@centos.org] On
> Behalf Of Phoenix, Merka
> Sent: Tuesday, November 15, 2011 18:48
> To: CentOS mailing list
> Subject: Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?
> 
> -Original Message-
> > Denniston, Todd A CIV NAVSURFWARCENDIV  Crane wrote:
> > Sent: Tuesday, 15 November, 2011 12:57
> > To: CentOS@centos.org
> > Subject: [CentOS] How can rpm "%{SUMMARY}" not be consistent?
> >

> > rpm -qa \
> >  --qf
> > '"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-
> %{RELEASE}","%{ARCH}","%{SUMMARY}"\n' \
> >   | sort -t\" -k3 > ${OUTFILE}
> >
> > Stuff the resulting ${OUTFILE} in an rcs file.
> >
> > And some days the rcs file will show deltas such as the following
> (which
> > was pulled from a rather recent set of flipflops):
> >
> > --- mach.csv2011/11/15 10:50:04
> > +++ mach.csv2011/11/15 09:22:53
> >
> > -"CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again
> shell
> > (bash) version 3.1."
> > +"CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again
> shell
> > (bash) version 3.2"
> 
> 
> Using the double quote (") as a delimiter, the third key would be a
> comma (,) (see below for an example)
> 
>  "A","B","C","D","E",...
> 1"2"3"4"5"6"7"8"9"A"B...
> 
> And since your sort command is sorting only on the fifth key, all the
> commas are already in order (unless there is a blank line in there
> somewhere). The order of the re cords within a sorted group may or may
> not be guaranteed to change.
> 
> Change your sort order from '-k3' to '-k2 -k4 -k6 -k8 -k10 -k12' to
> sort by Vendor, Name, Version, Version-Release, Arch, Summary and see
> if that helps.


Although you may be correct on the need to sort the NAME field using -k4
instead of -k3 ***, the question was not about the sort order, but about
the *content* of the SUMMARY fields being different between multiple
runs against the same database information for the same package, i.e.
notice the difference in the summary fields for the same bash package
above.


*** and this seems to explain a different but MUCH less annoying
confusion.

Thanks for that bit of help.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-16 Thread Akemi Yagi
On Tue, Nov 15, 2011 at 12:56 PM, Denniston, Todd A CIV
NAVSURFWARCENDIV Crane  wrote:
> I have been seeing something for quite some time which has confused me
> considerably for over a year, perhaps one of you can help me understand.
>
> Assumed: rpm queries are against _a_ database.
> Assumed: database queries against the same database, without changes to
> the data in the database, will return the same data.
>
> Confusion: then why are some of the summaries reported by rpm different?
>
> Each day I (cron.daily) run the following command
> rpm -qa \
>     --qf
> '"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","%
> {SUMMARY}"\n' \
>  | sort -t\" -k3 > ${OUTFILE}
>
> Stuff the resulting ${OUTFILE} in an rcs file.
>
> And some days the rcs file will show deltas such as the following (which
> was pulled from a rather recent set of flipflops):
>
> --- mach.csv    2011/11/15 10:50:04
> +++ mach.csv    2011/11/15 09:22:53
>
> -"CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again shell
> (bash) version 3.1."
> +"CentOS","bash","3.2","3.2-32.el5","i386","The GNU Bourne Again shell
> (bash) version 3.2"

What you are seeing is indeed odd. I see 'version 3.1' but not '3.2'
anywhere on the Summary line of bash. What is your kernel by the way?
uname -mr ?

Have you cleared yum cache? Not just running a 'yum clean all' but
emptying the /var/cache/yum directory ?

Akemi
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-16 Thread John Hodrien
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. What is your kernel by the way?
> uname -mr ?
>
> Have you cleared yum cache? Not just running a 'yum clean all' but
> emptying the /var/cache/yum directory ?

Why would yum cache have any bearing on what rpm reported?

jh
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-16 Thread Akemi Yagi
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. What is your kernel by the way?
>> uname -mr ?
>>
>> Have you cleared yum cache? Not just running a 'yum clean all' but
>> emptying the /var/cache/yum directory ?
>
> Why would yum cache have any bearing on what rpm reported?

In my attempts to reproduce what you are seeing, I used 'yum info' a
few times for the packages that were not on my systems. But in your
case (pure rpm operations) yum cache will not be relevant. By the way
I looked at both CentOS 5 and 6 but did not see any inconsistency. And
the reason why I asked about the kernel version was because it was not
clear which version/release of CentOS you are running. Sorry for the
noise. I will shut up now.

Akemi
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-16 Thread Denniston, Todd A CIV NAVSURFWARCENDIV Crane


> -Original Message-
> From: centos-boun...@centos.org [mailto:centos-boun...@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. What is your kernel by the
way?

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.

> >> uname -mr ?
> >>
> >> Have you cleared yum cache? Not just running a 'yum clean all' but
> >> emptying the /var/cache/yum directory ?
> >
> > Why would yum cache have any bearing on what rpm reported?
> 
> In my attempts to reproduce what you are seeing, I used 'yum info' a

It takes days/weeks of collecting the data via cron.daily and (I think)
having a few updates/installs happen between some of the runs.
On the boxes where I see it more, I often run the data collection script
immediately following updates.  I almost think there is some kind of rpm
housekeeping that gets done on a daily basis that could affect it, but I
can't figure out what it would be, because the rpm script in cron.daily
only dumps data (similar to what mine dumps) to /var/log/rpmpkgs... it
does not issue any rpm clean up commands. as I understand anacron, each
of the scripts should finish before anacron starts the next, so there
should not be any DB contention, between the rpm script and mine, I
would think.

At one time (in the mists of history, probably around RHEL 1|2) I
thought there was a daily rpm cleanup task, but I can't find it on Cent
5 systems.

> few times for the packages that were not on my systems. But in your
> case (pure rpm operations) yum cache will not be relevant. 

That is my thought too.
But I don't know where rpm could be getting the different info.

> By the way
> I looked at both CentOS 5 and 6 but did not see any inconsistency. 

I am on CentOS 5.

> And
> the reason why I asked about the kernel version was because it was not
> clear which version/release of CentOS you are running. Sorry for the
> noise. I will shut up now.
> 


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-16 Thread Nicolas Thierry-Mieg

Denniston, Todd A CIV NAVSURFWARCENDIV Crane wrote:
>
> At one time (in the mists of history, probably around RHEL 1|2) I
> thought there was a daily rpm cleanup task, but I can't find it on Cent
> 5 systems.

there is something in /etc/rc.sysinit, so it would happen on reboot:
$ grep rpm /etc/rc.sysinit
rm -f /var/lib/rpm/__db* &> /dev/null
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-29 Thread Denniston, Todd A CIV NAVSURFWARCENDIV Crane
> -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-boun...@centos.org [mailto:centos-boun...@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)?

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-29 Thread Denniston, Todd A CIV NAVSURFWARCENDIV Crane


> -Original Message-
> From: Denniston, Todd A CIV NAVSURFWARCENDIV Crane
> Sent: Tuesday, November 29, 2011 10:54
> To: 'CentOS mailing list'
> Subject: RE: [CentOS] How can rpm "%{SUMMARY}" not be consistent?
> 
> 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?

###And even more fun... try compat-db
$export LANG= ;rpm -q --qf
'"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","%
{SUMMARY}"\n'  compat-db
"CentOS","compat-db","4.2.52","4.2.52-5.1","i386","The Berkeley DB
database library for Red Hat Linux 7.x compatibility."
$ export LANG=en_US.UTF-8 ;rpm -q --qf
'"%{VENDOR}","%{NAME}","%{VERSION}","%{VERSION}-%{RELEASE}","%{ARCH}","%
{SUMMARY}"\n'  compat-db
"CentOS","compat-db","4.2.52","4.2.52-5.1","i386","The Berkeley DB
database library for CentOS 2.1 compatibility."

Yep that seems a strange one.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] How can rpm "%{SUMMARY}" not be consistent?

2011-11-29 Thread Bart Schaefer
On Tue, Nov 29, 2011 at 7:53 AM, Denniston, Todd A CIV
NAVSURFWARCENDIV Crane  wrote:
>
> Why does a number in a text string change based on LANG?

There's a separate dictionary of translated text strings (called a
catalog) for each language.  Those translations are looked up and
substituted for the default text based on the locale or language
settings in the environment.  If the number is stored in the catalog
as part of the string, you could see this effect.

It appears that either the catalogs have not been updated along with
the packages that make reference to them (which would be a bug), or
the updated catalogs have not been installed because they are part of
a "language pack" that is not listed as a dependency of all the
packages that refer to it (which likely is a deliberate optimization).
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos