forked from tcsr200722/appimage2deb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deb-unpack.sh
executable file
·73 lines (62 loc) · 1.24 KB
/
deb-unpack.sh
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh
#deb-unpack.sh
VER="0.5"
tproc=`basename $0`
echo "$tproc version $VER"
echo ""
usage()
{
tproc=`basename $0`
echo "usage:"
echo " bash $tproc packet.deb"
exit 0
}
goodfinish()
{
echo ""
echo "OK.\n"
echo ""
}
testargs()
{
if [ "x$1" = "x" -o "x$1" = "x--help" -o "x$1" = "x-h" ]
then
usage
fi
}
testcomponent()
{
tnocomp=""
tcomp="grep"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
tcomp="awk"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
tcomp="tar"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
tcomp="ar"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
tcomp="gzip"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
tcomp="md5sum"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
if [ "x$tnocomp" != "x" ]
then
echo "ERROR: Not found $tnocomp !"
echo ""
exit 1
fi
}
main()
{
tdeb="$1"
if [ -f "$tdeb" ]
then
echo "Unpack $tdeb..."
mkdir -p "DEBIAN"
mkdir -p "CONTENTS"
echo " DEBIAN..."
dpkg -e "$tdeb" "./DEBIAN"
echo " CONTENTS..."
dpkg -x "$tdeb" "./CONTENTS"
echo "OK."
fi
}
testargs "$@"
testcomponent
main "$@"
goodfinish
#end