forked from tcsr200722/appimage2deb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deb-depends-test.sh
executable file
·59 lines (50 loc) · 932 Bytes
/
deb-depends-test.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
#!/bin/sh
# deb-depends-test.sh
VER="5.0"
tproc=`basename $0`
echo "$tproc version $VER"
echo ""
usage()
{
tproc=`basename $0`
echo "usage:"
echo " sh $tproc elf-component"
}
testargs()
{
if [ "x$1" = "x" -o "x$1" = "x-h" -o "x$1" = "x--help" ]
then
usage
exit 0
fi
}
testcomponent()
{
tnocomp=""
tcomp="objdump"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
tcomp="dpkg"; [ $(which $tcomp) ] || tnocomp="$tnocomp $tcomp"
if [ "x$tnocomp" != "x" ]
then
echo "ERROR: Not found $tnocomp !"
echo ""
exit 1
fi
}
main()
{
telf="$1"
tlog="$telf.depends"
echo "" > "$tlog"
echo "$telf" >> "$tlog"
echo "" >> "$tlog"
objdump -x "$telf" | grep -w NEEDED | awk '{print $2}' | while read tlib
do
echo "Library: $tlib" >> "$tlog"
dpkg -S $tlib >> "$tlog"
echo "" >> "$tlog"
done
}
testargs $1
testcomponent
main $1
#end