aboutsummaryrefslogtreecommitdiffstats
path: root/archivers/deb2targz/files/deb2targz.sh
blob: 5762f939c6d00636165470dd4ce6f78a9b915765 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
#
# $FreeBSD$
#

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