FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 01-26-2009, 09:58 AM
Ian Forde
 
Default Shell Script - Compare packages. rpm.

On Mon, 2009-01-26 at 08:26 -0200, Tiago Dias wrote:
> Hi,
>
> I need a script which makes the package compação rpm's
> through two text files ...
>
> Since a file is the output of the command rpm-qa > pkg.out
>
> And the second file is a list of several packages rpm's,
> multiple versions and architectures.
>
> My idea is to compare a package x file pkg.out with several
> packages y of the file update.out and know whether a package and has a
> larger version of the package x installed and with that I return I
> have a package to be updated.
>
> Does anyone can help me do this comparison?

Looks like you want to see what the update packages are without doing
the updates, and without an internet connection. About 5 years ago I
would have suggest running 'rpm --freshen --test
packagename-from-update.out'. Today, I'd suggest saving even more time
and just a local instance of mrepo. Configure your yum repos
in /etc/yum.repos.d/ to point to the repository, and install the
yum-updatesd package to find out what the new packages are... Why
reinvent the wheel?

-I

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 01-26-2009, 11:56 AM
John Doe
 
Default Shell Script - Compare packages. rpm.

> From: Tiago Dias <tux.tiago@gmail.com>
> I need a script which makes the package compação rpm's through two text files ...
> Since a file is the output of the command rpm-qa > pkg.out
> And the second file is a list of several packages rpm's, multiple versions and architectures.

Just for the fun (and did not really test it):

cat pkg.out
|
awk ' { p=$1; n=match(p, "-[[:digit:]]+"); print substr(p,1,n); } '|
while read PKG; dogrep "$PKG[0-9]" update.out; done

I will leave you as an exercise to sort the results by versions and head (or tail) to keep the highest one... ^_^
But, if your update.out file contained only the latest package (and not all different versions), that should work.

JD




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

Thread Tools




All times are GMT. The time now is 12:54 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org