diff options
| author | Mattias Andrée <m@maandree.se> | 2026-05-28 18:59:10 +0200 |
|---|---|---|
| committer | Mattias Andrée <m@maandree.se> | 2026-05-28 18:59:22 +0200 |
| commit | 7627b2fb27b3a7bc530bb5700d172ee4e95b19af (patch) | |
| tree | f612563aa974c981ca1c9e4350a1095dff1bc2c8 /util | |
| parent | m (diff) | |
| download | release-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>
Diffstat (limited to 'util')
| -rw-r--r-- | util/README | 17 | ||||
| -rwxr-xr-x | util/gen-checksums | 13 |
2 files changed, 15 insertions, 15 deletions
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 |
