Re: new topic: quick and dirty rpm related tools

Greg Kurtzer <[email protected]> Tue, 10 Sep 2002 10:14:26 -0700
Newsgroups gmane.linux.redhat.rpm.grab
Message-ID <[email protected]>
Very cool! I like the methodology for obtaining the requirement of having a
package installed, but the next problem to solve is to compare its output
($responce) with the package that you want to install to make sure all 'is
needed by' are met.

Once again, I am hoping that RPM 4.1 will be our savior so GRAB does not have 
do this sort of thing...

Greg

On Sat, Aug 17, 2002 at 10:37:56AM +0200, Kimiko Koopman wrote:
> This little script searches for installed leaf packages and lists them
> alphabetically:
> 
> #!/bin/zsh
> pattern=${1:-*}
> packages=`rpm -qa | sort`
> foreach package (${(s:
> :)packages})
>   if [[ ${package/${~pattern}/x} == x ]] {
>     response=`rpm --test -e $package 2>&1`
>     if [[ $response == '' ]] {
>       echo $package
>     } else {
> #      echo $package is needed.
>     }
>   }
> end
> 
> You can give it a globbing pattern to limit the search to matching packages.
> For example, ckrpm x\* will search only packages with a name starting with 'x'.
> It uses rpm -e to avoid parsing the often lengthy output of rpm -q --requires
> and rpm -q --provides.
> 
> Kimiko
> _______________________________________________
> Grab mailing list
> [email protected]
> http://www.runlevelzero.net/mailman/listinfo/grab

-- 
Greg Kurtzer
[email protected]
http://www.runlevelzero.net
LINUX,... The choice of a GNU generation!
:wq