]> arthur.barton.de Git - netdata.git/blob - packaging/tar-compare
Merge pull request #1968 from ktsaou/master
[netdata.git] / packaging / tar-compare
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 '/: \.gitignore$/d' \
43         -e '/: config\.log$/d' \
44         -e '/: config\.status$/d' \
45         -e '/: config\.h.*$/d' \
46         -e '/: Makefile$/d' \
47         -e '/: hooks$/d' \
48         -e '/: packaging$/d' \
49         -e '/: stamp-h1$/d' \
50         -e '/: README\.md$/d' \
51         -e '/: tmp-anchor-links$/d' \
52         -e '/: tmp-manproc$/d' \
53         -e '/: .*\.tar\.\(gz\|bz2\|xz\)$/d' \
54         -e '/: unittest$/d' \
55         -e '/: iprange$/d' \
56         -e '/: .*\.o$/d' \
57         -e '/: CMakeLists.txt/d' \
58         -e '/: .travis.yml/d' \
59         -e '/: profile$/d' \
60         -e '/python.d: python-modules-installer\.sh\.in$/d' \
61         -e '/sbin: \(firehol\|fireqos\|link-balancer\)$/d' \
62         -e '/sbin: \(update-ipsets\|vnetbuild\|commands.sed\)$/d' > $MYTMP/out
63
64 cat $MYTMP/out
65 test -s $MYTMP/out && exit 1
66 exit 0