Mercurial > hg > easyhg
comparison deploy/linux/debian-dependencies.sh @ 700:21e4df9865af
Some work on Linux packaging
author | Chris Cannam |
---|---|
date | Wed, 12 Dec 2018 10:16:11 +0000 |
parents | |
children | 2b51235b3cb8 |
comparison
equal
deleted
inserted
replaced
699:646e48a0d3a5 | 700:21e4df9865af |
---|---|
1 #!/bin/bash | |
2 | |
3 target=$1 | |
4 | |
5 if [ ! -f "$target" ]; then | |
6 echo "Usage: $0 target-executable" | |
7 exit 1 | |
8 fi | |
9 | |
10 set -eu | |
11 | |
12 pfile=/tmp/packages_$$ | |
13 rfile=/tmp/redundant_$$ | |
14 | |
15 trap "rm -f $pfile $rfile" 0 | |
16 echo 1>&2 | |
17 | |
18 ldd "$target" | awk '{ print $3; }' | grep '^/' | while read lib; do | |
19 if test -n "$lib" ; then | |
20 dpkg-query -S "$lib" | |
21 fi | |
22 done | grep ': ' | awk -F: '{ print $1 }' | sort | uniq > $pfile | |
23 | |
24 echo "Packages providing required libraries:" 1>&2 | |
25 cat $pfile 1>&2 | |
26 echo 1>&2 | |
27 | |
28 for p in `cat $pfile`; do | |
29 echo Looking at $p 1>&2 | |
30 apt-cache showpkg "$p" | grep '^ ' | grep ',' | awk -F, '{ print $1; }' | \ | |
31 while read d; do | |
32 if grep -q '^'$d'$' $pfile; then | |
33 echo $p | |
34 fi | |
35 done | |
36 done | sort | uniq > $rfile | |
37 | |
38 echo "Packages that can be eliminated because other packages depend on them:" 1>&2 | |
39 cat $rfile 1>&2 | |
40 echo 1>&2 | |
41 | |
42 cat $pfile $rfile | sort | uniq -u | sed 's/$/,/' | fmt -1000 | sed 's/^/Depends: /' | sed 's/,$/, libc6/' | sed 's/libjack0,/jackd,/' | |
43 | |
44 |