aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2024-09-21 13:23:23 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2024-09-21 13:23:23 -0700
commit483655a28b0e5a1bc28ddd30bf0c925777ff2dd2 (patch)
treef29e2d46b8c5fec06fded903414e7c1b765aa32b
parentfix: typo in sync-origin-mirror-releases.sh (diff)
downloadmastermirror-scripts-483655a28b0e5a1bc28ddd30bf0c925777ff2dd2.tar.gz
mastermirror-scripts-483655a28b0e5a1bc28ddd30bf0c925777ff2dd2.tar.bz2
mastermirror-scripts-483655a28b0e5a1bc28ddd30bf0c925777ff2dd2.zip
create-squashfs-snapshot: work on daily snapshots
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xcreate-squashfs-snapshot24
1 files changed, 24 insertions, 0 deletions
diff --git a/create-squashfs-snapshot b/create-squashfs-snapshot
index 4fc35ff..1fafe9d 100755
--- a/create-squashfs-snapshot
+++ b/create-squashfs-snapshot
@@ -161,6 +161,30 @@ for algo in "${algo_LIST[@]}" ; do
ln -s -f "${reponame}-${today}${ext}" "${reponame}-current${ext}"
done
+# Find the files that do NOT have dated SHA512 checksums with them already.
+find . -name 'gentoo-*sqfs' -type f -printf '%f\n' \
+| cut -d. -f1 \
+| uniq \
+| perl -lne 'print $_ unless -f $_.".sha512sum.txt"' \
+| while read _prefix ; do
+ d=${_prefix}.sha512sum.txt
+
+ find . \
+ -name "${prefix}*" \
+ -a \( -name "*.sqfs" -o -name '*.sqdelta' \) \
+ -printf '%f\n' \
+ | xargs sha512sum \
+ | gpg --yes -u "${signkeyid}" --clearsign \
+ --comment "Daily: ${_prefix}" \
+ --output ${d}.tmp \
+ /dev/stdin
+
+ mv ${d}.tmp ${d}
+done
+
+# TODO: combine the above checksums (after verification) INSTEAD of
+# re-computing checksums on 18GB of data each day.
+#
# create checksums for snapshot and deltas
sha512sum -- *.sqfs *.sqdelta | \
gpg --yes -u "${signkeyid}" --clearsign \