3 # Copyright © 2011, 2012 Jakub Wilk <jwilk@debian.org>
5 # Redistribution and use in source and compiled forms, with or without
6 # modification, are permitted under any circumstances. No warranty.
10 printf 'Usage: %s <deb1> <deb2>\n' "$0"
18 base1=$(basename "$deb1" .deb)
19 base2=$(basename "$deb2" .deb)
20 tmpdir=$(mktemp -t -d)
21 if which git >/dev/null 2>&1; then
22 git init "$tmpdir/repo" >/dev/null 2>&1
26 git commit -m'initial commit' >/dev/null 2>&1;
27 git checkout -b "$base1" >/dev/null 2>&1;
29 dpkg-deb --raw-extract "$deb1" "$tmpdir/repo"
31 git add * >/dev/null 2>&1;
32 git rm emptyfile >/dev/null 2>&1;
33 git commit -m"add $base1" >/dev/null 2>&1;
34 git checkout master >/dev/null 2>&1;
35 git checkout -b "$base2" >/dev/null 2>&1;
37 dpkg-deb --raw-extract "$deb2" "$tmpdir/repo"
39 git add * >/dev/null 2>&1;
40 git rm emptyfile >/dev/null 2>&1;
41 git commit -m"add $base2" >/dev/null 2>&1;
42 git diff "$base1" "$base2" --;
46 mkdir -p "$tmpdir/a/$base1/"
47 dpkg-deb --raw-extract "$deb1" "$tmpdir/a/$base1/"
48 mkdir -p "$tmpdir/b/$base2/"
49 dpkg-deb --raw-extract "$deb2" "$tmpdir/b/$base2/"
51 diff -urN "a/$base1/" "b/$base2/"