From 55e9f58fa7c551aebfd6084b778cd942fa8b20ce Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Thu, 28 May 2026 18:46:27 +0200 Subject: Update (fixes support for a few edge cases, and leaves nothing laying around) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- util/validate-tarball | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 util/validate-tarball (limited to 'util/validate-tarball') 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 -- cgit v1.3.1