summaryrefslogtreecommitdiffstats
path: root/packaging/tar-compare
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2016-03-30 21:40:42 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2016-03-30 21:40:42 +0000
commit9ce153ce7167c11adba8ac225edc7a707e97c6eb (patch)
tree9f6e849cce2dcc7e5b4e9e6252c843dc2d0787a2 /packaging/tar-compare
downloadnetdata-9ce153ce7167c11adba8ac225edc7a707e97c6eb.tar.xz
netdata-9ce153ce7167c11adba8ac225edc7a707e97c6eb.zip
Imported Upstream version 1.0.0upstream/1.0.0
Diffstat (limited to 'packaging/tar-compare')
-rwxr-xr-xpackaging/tar-compare62
1 files changed, 62 insertions, 0 deletions
diff --git a/packaging/tar-compare b/packaging/tar-compare
new file mode 100755
index 000000000..02ec3c293
--- /dev/null
+++ b/packaging/tar-compare
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+# When provided with a git repo, which has been used to produce a
+# distribution tar.gz (with make dist) and the resultant tar-file,
+# lists files which appear in one or the other only, to help check
+# for missing EXTRA_DIST entries in Makefile.am files.
+
+scriptname=tar-compare
+if ! MYTMP=$(mktemp -d -t $scriptname-XXXXXX)
+then
+ echo >&2
+ echo >&2
+ echo >&2 "Cannot create temporary directory."
+ echo >&2
+ exit 1
+fi
+
+cleanup() {
+ status=$?
+ rm -rf "${MYTMP}"
+ exit $status
+}
+
+# clean up if we get stopped by Crtl-C or forced logout or normal exit
+trap cleanup INT
+trap cleanup HUP
+trap cleanup 0
+
+if [ $# -ne 2 ]
+then
+ echo "tar-compare git-dir tar-gz-file"
+ exit 1
+fi
+
+mkdir $MYTMP/unpack
+tar xfzC "$2" $MYTMP/unpack
+diff -r "$1" $MYTMP/unpack/* | grep "^Only" | sed \
+ -e '/: autom4te\.cache$/d' \
+ -e '/: \.deps$/d' \
+ -e '/: \.git$/d' \
+ -e '/: \.gitattributes$/d' \
+ -e '/: \.gitignore$/d' \
+ -e '/: config\.log$/d' \
+ -e '/: config\.status$/d' \
+ -e '/: config\.h.*$/d' \
+ -e '/: Makefile$/d' \
+ -e '/: hooks$/d' \
+ -e '/: packaging$/d' \
+ -e '/: stamp-h1$/d' \
+ -e '/: README\.md$/d' \
+ -e '/: tmp-anchor-links$/d' \
+ -e '/: tmp-manproc$/d' \
+ -e '/: .*\.tar\.\(gz\|bz2\|xz\)$/d' \
+ -e '/: unittest$/d' \
+ -e '/: iprange$/d' \
+ -e '/: .*\.o$/d' \
+ -e '/sbin: \(firehol\|fireqos\|link-balancer\)$/d' \
+ -e '/sbin: \(update-ipsets\|vnetbuild\|commands.sed\)$/d' > $MYTMP/out
+
+cat $MYTMP/out
+test -s $MYTMP/out && exit 1
+exit 0