3 # This should work with the GNU version of tar and gzip!
4 # This should work with the bash or ash shell!
5 # Requires the programs (ar, tar, gzip, and the pager more or less).
9 Usage: undeb -c package.deb <Print control file info>
10 undeb -l package.deb <List contents of deb package>
11 undeb -x package.deb /foo/boo <Extract deb package to this directory,
12 put . for current directory>
20 if [ -z "${deb}" ]; then
22 elif [ ! -s "${deb}" ]; then
23 echo "Can't find ${deb}!"
30 elif [ "$1" = "-l" ]; then
32 type more >/dev
/null
2>&1 && pager
=more
33 type less >/dev
/null
2>&1 && pager
=less
34 [ -z "${pager}" ] && echo "No pager found!" && exit 1
36 ar -p "${deb}" control.
tar.gz |
tar -xzO *control
37 printf "\nPress enter to scroll, q to Quit!\n\n"
38 ar -p "${deb}" data.
tar.gz |
tar -tzv
41 elif [ "$1" = "-c" ]; then
43 ar -p "${deb}" control.
tar.gz |
tar -xzO *control
45 elif [ "$1" = "-x" ]; then
49 elif [ ! -d "$3" ]; then
50 echo "No such directory $3!"
53 ar -p "${deb}" data.
tar.gz |
tar -xzvpf - -C "$3" ||
exit
55 echo "Extracted ${deb} to $3!"