File: compare-tar

package info (click to toggle)
fakeroot 1.14.4-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,000 kB
  • ctags: 565
  • sloc: sh: 10,485; ansic: 3,538; makefile: 290; perl: 14
file content (23 lines) | stat: -rwxr-xr-x 643 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
set -e
echo compare-tar:

gzip -dc $1 | tar -tvf - |awk '{print $1, $2, $3, $NF}' |sort > tmp-1
gzip -dc $2 | tar -tvf - |awk '{print $1, $2, $3, $NF}' |sort > tmp-2

diff tmp-1 tmp-2 > tmp-diff || true

if test -s tmp-diff; then
  echo tar files differ:
  cat tmp-diff
  if test -n "$FAKEROOT_INTERACTIVE_TARTEST"; then
    echo
    echo 'You are now inside the "fakeroot" shell, so that you can examine'
    echo the problem more closely. Just type exit to get away from here.
    echo tmp-1 comes from ../tartest.gz.uue, tmp-2 is the just-built
    echo faketar.tar.gz, with the current fakeroot.
    sh
  fi
  exit 1
fi  
exit 0