4 echo "Usage: undeb -c package.deb <Print control file info>"
5 echo " undeb -l package.deb <List contents of deb package>"
6 echo " undeb -x package.deb /foo/boo <Extract deb package to this directory,"
7 echo " put . for current directory>"
14 if [ "$deb" = "" ]; then
16 elif [ ! -s "$deb" ]; then
17 echo "Can't find $deb!"
22 if [ "$1" = "" ]; then
24 elif [ "$1" = "-l" ]; then
26 type more >/dev/null 2>&1 && pager=more
27 type less >/dev/null 2>&1 && pager=less
29 (ar -p $deb control.tar.gz | gunzip -c | tar -x -O control ; echo -e "\nPress enter to scroll, q to Quit!\n" ; ar -p $deb data.tar.gz | gunzip -c | tar -t -v 2>/dev/null) | $pager
31 elif [ "$1" = "-c" ]; then
33 ar -p $deb control.tar.gz | gunzip -c | tar -x -O control
35 elif [ "$1" = "-x" ]; then
37 if [ "$3" = "" ]; then
39 elif [ ! -d "$3" ]; then
40 echo "No such directory $3!"
43 ar -p $deb data.tar.gz | gunzip | (cd $3 ; tar -x -v -f -) || exit
45 echo "Extracted $deb to $3!"