aboutsummaryrefslogtreecommitdiff
path: root/utils/verify_dist_tarball.sh
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2022-05-26 15:07:22 +0200
committerGitHub <noreply@github.com>2022-05-26 15:07:22 +0200
commit78dfe959cb175610726ae06341e55aeb39f0feba (patch)
treee0d468b515bea9ffd7d7ca5b623ff437060491c0 /utils/verify_dist_tarball.sh
parent9614b66b449d84a810b0b05167c9e408bfca3d39 (diff)
Added script to compare and verify the output of `make dist'. (#1551)
This fixes some build/test issues resulting when using tarballs. * nDPI uses autotools (especially autoconf) in a wrong way, see #1163 Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'utils/verify_dist_tarball.sh')
-rwxr-xr-xutils/verify_dist_tarball.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/utils/verify_dist_tarball.sh b/utils/verify_dist_tarball.sh
new file mode 100755
index 000000000..0bfbe71c1
--- /dev/null
+++ b/utils/verify_dist_tarball.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env sh
+
+EXCLUDE_PATTERN="(.*\.m4$|Makefile$|Makefile\.in$|utils/verify_dist_tarball\.sh|^packages/debian/.*|^packages/debian|^test-driver|^config\.guess|^config\.sub|^compile|^configure|/|depcomp|.gitattributes|.gitignore|install-sh|ltmain.sh|missing|src/include/ndpi_config\.h\.in)$"
+
+set -x
+set -e
+
+cd "$(dirname "${0}")/.."
+
+git ls-tree --full-tree --name-only -r HEAD | grep -vE "${EXCLUDE_PATTERN}" | sort >/tmp/ndpi-dist-verify-git.txt
+
+TARBALL="${1}"
+if [ "x${TARBALL}" = x ]; then
+ if [ ! -r Makefile ]; then
+ ./autogen.sh
+ fi
+ make dist
+ AC_VERSION="$(sed -n 's/^AC_INIT.*\([[:digit:]]\+\.[[:digit:]]\+\.[[:digit:]]\+\).*$/\1/gp' < configure.ac)"
+ TARBALL="./libndpi-${AC_VERSION}.tar.gz"
+fi
+
+tar -tzf "${TARBALL}" | sed -n 's|^[^/]*/||gp' | grep -v '^$' | grep -vE "${EXCLUDE_PATTERN}" | sort >/tmp/ndpi-dist-verify-tar.txt
+
+diff -u0 /tmp/ndpi-dist-verify-git.txt /tmp/ndpi-dist-verify-tar.txt
+
+rm -f /tmp/ndpi-dist-verify-git.txt /tmp/ndpi-dist-verify-tar.txt