comparison misc/debian-dependencies.sh @ 863:ac805901f02a

Output for control file
author Chris Cannam
date Wed, 24 Sep 2014 12:12:20 +0100
parents f84413dd5a7a
children
comparison
equal deleted inserted replaced
862:129b679734d0 863:ac805901f02a
9 9
10 pfile=/tmp/packages_$$ 10 pfile=/tmp/packages_$$
11 rfile=/tmp/redundant_$$ 11 rfile=/tmp/redundant_$$
12 12
13 trap "rm -f $pfile $rfile" 0 13 trap "rm -f $pfile $rfile" 0
14 echo 14 echo 1>&2
15 15
16 ldd "$target" | awk '{ print $3; }' | grep '^/' | while read lib; do 16 ldd "$target" | awk '{ print $3; }' | grep '^/' | while read lib; do
17 if test -n "$lib" ; then 17 if test -n "$lib" ; then
18 dpkg-query -S "$lib" 18 dpkg-query -S "$lib"
19 fi 19 fi
20 done | grep ': ' | awk -F: '{ print $1 }' | sort | uniq > $pfile 20 done | grep ': ' | awk -F: '{ print $1 }' | sort | uniq > $pfile
21 21
22 echo "Packages providing required libraries:" 22 echo "Packages providing required libraries:" 1>&2
23 cat $pfile 23 cat $pfile 1>&2
24 echo 24 echo 1>&2
25 25
26 for p in `cat $pfile`; do 26 for p in `cat $pfile`; do
27 echo Looking at $p 1>&2 27 echo Looking at $p 1>&2
28 apt-cache showpkg "$p" | grep '^ ' | grep ',' | awk -F, '{ print $1; }' | \ 28 apt-cache showpkg "$p" | grep '^ ' | grep ',' | awk -F, '{ print $1; }' | \
29 while read d; do 29 while read d; do
30 if grep -q '^'$d'$' $pfile; then 30 if grep -q '^'$d'$' $pfile; then
31 echo $p 31 echo $p 1>&2
32 fi 32 fi
33 done 33 done
34 done | sort | uniq > $rfile 34 done | sort | uniq > $rfile
35 35
36 echo "Packages that can be eliminated because other packages depend on them:" 36 echo "Packages that can be eliminated because other packages depend on them:" 1>&2
37 cat $rfile 37 cat $rfile 1>&2
38 echo 38 echo 1>&2
39 39
40 echo "Remaining required packages:" 40 cat $pfile $rfile | sort | uniq -u | sed 's/$/,/' | fmt -1000 | sed 's/^/Depends: /'
41 cat $pfile $rfile | sort | uniq -u
42 41
42