Re: Shell Script - Compare packages. rpm.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> From: Tiago Dias <tux.tiago@xxxxxxxxx>
> 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@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux