Debian Codegraph @

packaging/tar-compare

raw symbols SCIP
1 #!/bin/sh
2
3 # When provided with a git repo, which has been used to produce a
4 # distribution tar.gz (with make dist) and the resultant tar-file,
5 # lists files which appear in one or the other only, to help check
6 # for missing EXTRA_DIST entries in Makefile.am files.
7
8 scriptname=tar-compare
9 if ! MYTMP=$(mktemp -d -t $scriptname-XXXXXX)
10 then
11 echo >&2
12 echo >&2
13 echo >&2 "Cannot create temporary directory."
14 echo >&2
15 exit 1
16 fi
17
18 cleanup() {
19 status=$?
20 rm -rf "${MYTMP}"
21 exit $status
22 }
23
24 # clean up if we get stopped by Crtl-C or forced logout or normal exit
25 trap cleanup INT
26 trap cleanup HUP
27 trap cleanup 0
28
29 if [ $# -ne 2 ]
30 then
31 echo "tar-compare git-dir tar-gz-file"
32 exit 1
33 fi
34
35 mkdir $MYTMP/unpack
36 tar xfzC "$2" $MYTMP/unpack
37 diff -r "$1" $MYTMP/unpack/* | grep "^Only" | sed \
38 -e '/: autom4te\.cache$/d' \
39 -e '/: \.deps$/d' \
40 -e '/: \.git$/d' \
41 -e '/: \.gitattributes$/d' \
42 -e '/: \.github$/d' \
43 -e '/: \.gitignore$/d' \
44 -e '/: \.travis$/d' \
45 -e '/: \.travis.yml$/d' \
46 -e '/: config\.log$/d' \
47 -e '/: config\.status$/d' \
48 -e '/: config\.h.*$/d' \
49 -e '/: Makefile$/d' \
50 -e '/: hooks$/d' \
51 -e '/: packaging$/d' \
52 -e '/: stamp-h1$/d' \
53 -e '/: README\.md$/d' \
54 -e '/: tmp-anchor-links$/d' \
55 -e '/: tmp-manproc$/d' \
56 -e '/: .*\.tar\.\(gz\|bz2\|xz\)$/d' \
57 > $MYTMP/out
58
59 cat $MYTMP/out
60 test -s $MYTMP/out && exit 1
61 exit 0