new tool: args2env
[hband-tools.git] / user-tools / debdiff
blob35e3faeec708251a68c06d540d84056a1015fa27
1 #!/bin/bash
3 true <<EOF
4 =pod
6 =head1 NAME
8 debdiff - Display differences between 2 Debian packages (*.deb files)
10 =cut
12 EOF
15 view_deb()
17 dpkg-deb -I "$1"
18 echo
19 dpkg-deb -c "$1" | sort -k6
22 declare -a opts
23 f1=''
24 f2=''
26 while [ -n "$1" ]
28 case "$1" in
29 -*)
30 opts+=("$1")
33 if [ -z "$f1" ]
34 then
35 f1=$1
36 elif [ -z "$f2" ]
37 then
38 f2=$1
39 else
40 opts+=("$1")
43 esac
44 shift
45 done
47 diff "${opts[@]}" <(view_deb "$f1") <(view_deb "$f2")