aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-05-28 18:59:10 +0200
committerMattias Andrée <m@maandree.se>2026-05-28 18:59:22 +0200
commit7627b2fb27b3a7bc530bb5700d172ee4e95b19af (patch)
treef612563aa974c981ca1c9e4350a1095dff1bc2c8
parentm (diff)
downloadrelease-scripts-7627b2fb27b3a7bc530bb5700d172ee4e95b19af.tar.gz
release-scripts-7627b2fb27b3a7bc530bb5700d172ee4e95b19af.tar.bz2
release-scripts-7627b2fb27b3a7bc530bb5700d172ee4e95b19af.tar.xz
Fix error handling and make util/ setup and domain agnostic
Signed-off-by: Mattias Andrée <m@maandree.se>
-rwxr-xr-xgen-checksums4
-rw-r--r--util/README17
-rwxr-xr-xutil/gen-checksums13
3 files changed, 18 insertions, 16 deletions
diff --git a/gen-checksums b/gen-checksums
index f894a38..d33b7b2 100755
--- a/gen-checksums
+++ b/gen-checksums
@@ -19,4 +19,6 @@ sumfile="rel/$2/$3.checksums"
test -e "${tarball}" || die "${tarball} does not exist"
test -e "${infofile}" || die "${infofile} does not exist"
-"$(dirname -- "$0")"/util/gen-checksums "${tarball}" "${gitdir}" < "${infofile}" > "${sumfile}"
+grep '^Tarball: ' < "${infofile}" | cut -d ' ' -f 2 | \
+ grep -v '^https://maandree.se/static/' |
+ "$(dirname -- "$0")"/util/gen-checksums "${tarball}" "${gitdir}" > "${sumfile}"
diff --git a/util/README b/util/README
index b4ce9b4..cc72f08 100644
--- a/util/README
+++ b/util/README
@@ -62,19 +62,16 @@ get-and-check tarball-url reference-dir work-dir
checksums.
-gen-checksums tarball git-dir < version-info-file > checksum-listing
+gen-checksums tarball git-dir < tarball-url-list > checksum-listing
This brings all of the above together. The tarball,
which is assumed to be the tarball for the static release
is validates against a known good directory (git-dir),
for which the tarball is supposted to be generated from,
but this check validates that git itself is not manipulating
- the tarballs. Then it reads stdin for URLs in lines that
- begin with "Tarball: " (however, the URL for the static
- release is discarded as it is assumed to not exist yet
- but be the same file as input as the argument). These
- URLs are used to download release tarballs from all
- mirrors; they are also validates against the known good
- directory. The checksums for all tarballs, both the
- one provided in the command line and those downloaded,
- are output to stdout.
+ the tarballs. Then it reads each line from, treating each
+ line as an URL. These URLs are used to download release
+ tarballs from all mirrors; they are also validates against
+ the known good directory. The checksums for all tarballs,
+ both the one provided in the command line and those
+ downloaded, are output to stdout.
diff --git a/util/gen-checksums b/util/gen-checksums
index bb1f981..2d404a0 100755
--- a/util/gen-checksums
+++ b/util/gen-checksums
@@ -4,7 +4,7 @@
set -e
if test ! $# = 2 || test -t 0 || test -t 1; then
- printf 'usage: %s tarball git-dir < version-info-file > checksum-listing\n' "$0" >&2
+ printf 'usage: %s tarball git-dir < tarball-url-list > checksum-listing\n' "$0" >&2
fi
tarball="$1"
@@ -15,9 +15,12 @@ utildir="$(dirname -- "$0")"
"${utildir}"/tmpmount /var/empty "${utildir}"/validate-tarball "${tarball}" "${gitdir}" /var/empty
-grep '^Tarball: ' | cut -d ' ' -f 2 | grep -v '^https://maandree.se/static/' | (
+get_checksums () {
"${utildir}"/get-checksums "${tarball}"
- while read -r url; do
+ while read -r url; do
"${utildir}"/tmpmount /var/empty "${utildir}"/get-and-check "${url}" "${gitdir}" /var/empty
- done
-) | "${utildir}"/order-checksums
+ done
+}
+
+checksums="$(get_checksums)"
+printf '%s\n' "$checksums" | "${utildir}"/order-checksums