freebsd-ports/archivers/deb2targz/files/deb2targz.sh
2021-04-06 16:31:13 +02:00

25 lines
429 B
Bash

#!/bin/sh
#
# Distributed under the BSD 2-clause Simplified License.
#
PATH=/bin:/usr/bin
[ $# -eq 0 ] && {
echo 1>&2 "Usage: ${0##*/} <deb-file> [<deb-file> ...]";
exit 1;
}
for i in "$@"; do
[ "${i##*.}" != "deb" ] && {
echo "${0##*/}: ignoring '$i' (not a .deb)";
continue;
}
for file in `tar tf "$i"`; do
[ "${file%%.*}" = "data" ] && {
tar xOf "${i}" "${file}" > "${i%%.deb}.${file#data.}"
}
done
done