4 echo "Usage: unrpm -l package.rpm <List contents of rpm package>"
5 echo " unrpm -x package.rpm /foo/boo <Extract rpm package to this directory,"
6 echo " put . for current directory>"
13 if [ "$rpm" = "" ]; then
15 elif [ ! -s "$rpm" ]; then
16 echo "Can't find $rpm!"
21 if [ "$1" = "" ]; then
23 elif [ "$1" = "-l" ]; then
25 type more >/dev/null 2>&1 && pager=more
26 type less >/dev/null 2>&1 && pager=less
27 (echo -e "\nPress enter to scroll, q to Quit!\n" ; rpmunpack < $rpm | gunzip -c | cpio -tvf --quiet) | $pager
29 elif [ "$1" = "-x" ]; then
31 if [ "$3" = "" ]; then
33 elif [ ! -d "$3" ]; then
34 echo "No such directory $3!"
37 rpmunpack < $rpm | gunzip | (cd $3 ; cpio -idmuv) || exit
39 echo "Extracted $rpm to $3!"