aboutsummaryrefslogtreecommitdiffstats
path: root/util/validate-tarball
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-28 18:46:27 +0200
committerMattias Andrée <m@maandree.se>2026-05-28 18:46:27 +0200
commit55e9f58fa7c551aebfd6084b778cd942fa8b20ce (patch)
tree7177e49a9c3a3c2e9cd4f88e8507cb19c9f6c1b0 /util/validate-tarball
parentm fix (diff)
downloadrelease-scripts-55e9f58fa7c551aebfd6084b778cd942fa8b20ce.tar.gz
release-scripts-55e9f58fa7c551aebfd6084b778cd942fa8b20ce.tar.bz2
release-scripts-55e9f58fa7c551aebfd6084b778cd942fa8b20ce.tar.xz
Update (fixes support for a few edge cases, and leaves nothing laying around)
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to '')
-rwxr-xr-xutil/validate-tarball27
1 files changed, 27 insertions, 0 deletions
diff --git a/util/validate-tarball b/util/validate-tarball
new file mode 100755
index 0000000..14aff6d
--- /dev/null
+++ b/util/validate-tarball
@@ -0,0 +1,27 @@
+#!/bin/sh
+# See LICENSE file for copyright and license details.
+
+set -e
+
+if ! test $# = 3; then
+ printf 'usage: %s tarball git-dir work-dir\n' "$0" >&2
+ exit 1
+fi
+
+utildir="$(dirname -- "$0")"
+
+dir="$3/$$.tmpdir"
+rm -rf -- "${dir}"
+mkdir -- "${dir}"
+
+gunzip < "$1" | (cd -- "${dir}" && tar -x)
+
+(cd -- "$2" && git ls-files -z) > "$3/listing-1"
+(cd -- "${dir}"/*/ && find -print0) > "$3/listing-2"
+
+set +e
+"${utildir}"/repodiff "$2" "$3/listing-1" "${dir}"/* "$3/listing-2"
+ret=$?
+
+rm -rf -- "${dir}"
+exit $ret