| # This should work with the GNU version of tar and gzip! |
| # This should work with the bash or ash shell! |
| # Requires the programs (ar, tar, gzip, and the pager more or less). |
| echo "Usage: undeb -c package.deb <Print control file info>" |
| echo " undeb -l package.deb <List contents of deb package>" |
| echo " undeb -x package.deb /foo/boo <Extract deb package to this directory," |
| echo " put . for current directory>" |
| elif [ ! -s "$deb" ]; then |
| elif [ "$1" = "-l" ]; then |
| type more >/dev/null 2>&1 && pager=more |
| type less >/dev/null 2>&1 && pager=less |
| [ "$pager" = "" ] && echo "No pager found!" && exit |
| (ar -p $deb control.tar.gz | tar -xzO *control ; echo -e "\nPress enter to scroll, q to Quit!\n" ; ar -p $deb data.tar.gz | tar -tzv) | $pager |
| elif [ "$1" = "-c" ]; then |
| ar -p $deb control.tar.gz | tar -xzO *control |
| elif [ "$1" = "-x" ]; then |
| echo "No such directory $3!" |
| ar -p $deb data.tar.gz | tar -xzvpf - -C $3 || exit |
| echo "Extracted $deb to $3!" |