Register
It is currently Thu Dec 18, 2014 6:42 am

Comparing packages


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Tue Feb 09, 2010 8:23 am   

Joined: Tue Feb 09, 2010 8:16 am
Posts: 1
Hi,

I used the following command to retrieve a list of packages and saved them into a file:

rpm -q --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH}) \n" binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc glibc-common glibc-devel-2.5 libaio libaio-devel libgcc libstdc++ libstdc++-devel make sysstat > output.txt

I want to compare these packages in the output.txt file to those on another server.
The packages on the other server must be at least the same version or higher.

The output of my output.txt file looks like this:
binutils-2.17.50.0.6-2.el5 (x86_64)
compat-libstdc++-33-3.2.3-61 (i386)
compat-libstdc++-33-3.2.3-61 (x86_64)
elfutils-libelf-0.125-3.el5 (x86_64)
elfutils-libelf-devel-0.125-3.el5 (x86_64)
gcc-4.1.1-52.el5 (x86_64)
gcc-c++-4.1.1-52.el5 (x86_64)
glibc-2.5-12 (i686)
glibc-2.5-12 (x86_64)
glibc-common-2.5-12 (x86_64)
glibc-devel-2.5-12 (x86_64)
glibc-devel-2.5-12 (i386)
libaio-0.3.106-3.2 (x86_64)
libaio-0.3.106-3.2 (i386)
libaio-devel-0.3.106-3.2 (x86_64)
libgcc-4.1.1-52.el5 (x86_64)
libgcc-4.1.1-52.el5 (i386)
libstdc++-4.1.1-52.el5 (x86_64)
libstdc++-4.1.1-52.el5 (i386)
libstdc++-devel-4.1.1-52.el5 (x86_64)
make-3.81-1.1 (x86_64)
sysstat-7.0.0-3.el5 (x86_64)

As you can see there are 32-bit and 64-bit packages of the same rpms and further more I've noticed that on other servers the order in which the 32-bit and 64-bit packages are written to the file may vary.

Can someone please help me with a script to check this as I have over 40 servers to do this on and a script will simplify the process a lot!!!

Thanks in advance.


Top
 Profile  
 PostPosted: Tue Feb 23, 2010 10:53 pm   
User avatar

Joined: Sat Jun 13, 2009 8:53 pm
Posts: 73
Location: Texas!
You could use the rpm query tag "BUILDTIME", if it is accurate, to compare the two. I don't have a system with rpm at my disposal, so I can't check, but major packages like those should have consistent build times. It would be worth checking out.

The other option (which might be painful in bash) is to use regexes to pull out each part of the version and compare it. I would look at this for a start: http://www.linuxjournal.com/content/bash-regular-expressions.

Sorry I can't give you a more full solution.
- thobbs


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP