aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'create-squashfs-snapshot')
-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 \