hush: add leak detector helper; fix/add tests for it
[oweals/busybox.git] / examples / unrpm
index 9ab37be0ac92a10275c30f6722b6908a059a99be..7fd3676f6496e2e4444fcd48eb93c3f77b5b4b0c 100644 (file)
@@ -7,12 +7,12 @@
 usage() {
 echo "Usage: unrpm -l package.rpm            <List contents of rpm package>"
 echo "       unrpm -x package.rpm /foo/boo   <Extract rpm package to this directory,"
-echo "                                        put . for current directory>"  
+echo "                                        put . for current directory>"
 exit
 }
 
 rpm=$2
+
 exist() {
 if [ "$rpm" = "" ]; then
 usage
@@ -29,7 +29,7 @@ exist
 type more >/dev/null 2>&1 && pager=more
 type less >/dev/null 2>&1 && pager=less
 [ "$pager" = "" ] && echo "No pager found!" && exit
-(echo -e "\nPress enter to scroll, q to Quit!\n" ; rpmunpack < $rpm | gzip -dc | cpio -tv --quiet) | $pager 
+(echo -e "\nPress enter to scroll, q to Quit!\n" ; rpm2cpio $rpm | cpio -tv --quiet) | $pager
 exit
 elif [ "$1" = "-x" ]; then
 exist
@@ -39,7 +39,7 @@ elif [ ! -d "$3" ]; then
 echo "No such directory $3!"
 exit
 fi
-rpmunpack < $rpm | gzip -d | (umask 0 ; cd $3 ; cpio -idmuv) || exit 
+rpm2cpio $rpm | (umask 0 ; cd $3 ; cpio -idmuv) || exit
 echo
 echo "Extracted $rpm to $3!"
 exit