RE: Semi-OT: Neat Trick regarding RPM query format

From: Taylor, Chris David <ChrisDavid.Taylor_at_ingrambarge.com>
Date: Mon, 9 Jul 2012 08:49:58 -0500
Message-ID: <C5533BD628A9524496D63801704AE56D75B2C7DE6C_at_SPOBMEXC14.adprod.directory>



Discovered a side effect of this - if you change the default alias "-q" to include the architecture, it seems to break raccheck which will complain about missing dependencies. Apparently raccheck isn't built to understand the additional info returned (or the format is incorrect perhaps).

So in my case I changed the -q alias to -* (for now) and raccheck went back to behaving normally.

Thanks,

Chris Taylor

"Quality is never an accident; it is always the result of intelligent effort."
-- John Ruskin (English Writer 1819-1900)

Any views and/or opinions expressed herein are my own and do not necessarily reflect the views of Ingram Industries, its affiliates, its subsidiaries or its employees.

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Taylor, Chris David Sent: Monday, July 02, 2012 11:03 AM
To: 'oracle-l_at_freelists.org'
Subject: Semi-OT: Neat Trick regarding RPM query format

(Just sending this out there in case anyone is interested. If you have a better way, pass it on...)

rpm can provide you with the name and architecture when querying the installed rpms.

Typically rpm -q filename will only tell you it is installed, but not which architecture(s).

[root_at_rac2 /etc]$ rpm -qa glibc
glibc-2.5-81
glibc-2.5-81

To get the ARCH you can use --queryformat '%{NAME}-%{VERSION}-%{RELEASE}-%{ARCH}\n'

[root_at_rac2 /etc]$ rpm -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n' glibc glibc-2.5-81 x86_64
glibc-2.5-81 i686

To make this simpler, you can create (or add) an alias to /etc/popt, or ~/.popt:

rpm     exec -q                 rpmq -q --queryformat '%{NAME}-%{VERSION}-%{RELEASE} %{ARCH}\n'

Take a look at /usr/lib/rpm/rpmopt-{version} to see a horde of aliases that rpm uses to get an idea what's available.

Chris Taylor

"Quality is never an accident; it is always the result of intelligent effort."
-- John Ruskin (English Writer 1819-1900)

Any views and/or opinions expressed herein are my own and do not necessarily reflect the views of Ingram Industries, its affiliates, its subsidiaries or its employees.

--
http://www.freelists.org/webpage/oracle-l




--
http://www.freelists.org/webpage/oracle-l
Received on Mon Jul 09 2012 - 08:49:58 CDT

Original text of this message