Here is a  little utility I use  to build a listing of  the content of
all the rpm in a directory. I hope it could be usefull to someone else
and perhaps a listing like that  could be included in the ISO image or
in the ftp areas. Any comment welcome.

PS: I'm a newbie in rpm management and this can already exist elsewhere.

#!/bin/sh
# File          : rpms-content
# Author        : Frederic Lepied
# Created on    : Sun Sep 19 20:53:55 1999
# Version       : $Id: rpms-content,v 1.2 1999/09/19 20:04:34 fred Exp $

# Display the content of all rpms found in the specified directory
# or in the current directory with the following format:
#
# <file path name>                     <package name>
#
# The output is sorted.

output() {
    args=$*
    read a
    while [ -n "$a" ]; do
        printf "%-75s %s\n" $a $args
        read a
    done
}

if [ $# -gt 1 ]; then
    echo "usage: `basename $0` [<dir>]" 1>&2
    exit 1
fi

if [ $# -gt 0 ]; then
    cd $1
fi

for p in `find . -name '*.rpm'`; do
    base=`rpm --query --queryformat %{NAME} -p $p`
    echo $base 1>&2
    rpm --query --list --provides -p $p | output $base
done | sort

# rpms-contents ends here

-- 
Fred - May the source be with you

Reply via email to