File: compare-tar

package info (click to toggle)
fakeroot 0.0-17
  • links: PTS
  • area: main
  • in suites: slink
  • size: 160 kB
  • ctags: 189
  • sloc: ansic: 690; cpp: 543; makefile: 126; sh: 68
file content (24 lines) | stat: -rwxr-xr-x 703 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
24
#!/bin/bash 
set -e

tar -tvzf $1 |cut -b -31,48- > tmp-1
tar -tvzf $2 |cut -b -31,48- > tmp-2

diff -u tmp-1 tmp-2 > tmp-diff

if test -s tmp-diff; then
  echo tar files differ:
  cat tmp-diff
  #The following is because I suspect that non-developpers of fakeroot
  #don't want this (confusing) prompt here, but I do, usually (my system is
  #called "rulcmc").
  if test `hostname` = "rulcmc"; then
    echo
    echo Youre 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.
    bash
  fi
  exit 1
fi