aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2024-09-24 23:22:40 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2024-09-24 23:22:40 -0700
commite270b2fe98a5b396b9b63a0987566226c68bb9a5 (patch)
treeacd75821ff237ff9fd59b885086b66eedb4f9790 /create-squashfs-snapshot
parentcreate-squashfs-snapshot: sort checksum files to avoid flaps (diff)
downloadmastermirror-scripts-e270b2fe98a5b396b9b63a0987566226c68bb9a5.tar.gz
mastermirror-scripts-e270b2fe98a5b396b9b63a0987566226c68bb9a5.tar.bz2
mastermirror-scripts-e270b2fe98a5b396b9b63a0987566226c68bb9a5.zip
create-squashfs-snapshot: add timestamps and diff success20240925T062243Z
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'create-squashfs-snapshot')
-rwxr-xr-xcreate-squashfs-snapshot8
1 files changed, 6 insertions, 2 deletions
diff --git a/create-squashfs-snapshot b/create-squashfs-snapshot
index aa4bc4e..5e72e1e 100755
--- a/create-squashfs-snapshot
+++ b/create-squashfs-snapshot
@@ -164,6 +164,7 @@ done
# create checksums for snapshot and deltas
# OLD LOGIC, that scans entire 18GB
+date +ts-old-checksum-start=%s.%N
ls -d -- *.sqfs *.sqdelta \
| xargs sha512sum -- \
| sort -k +2 \
@@ -176,6 +177,7 @@ ls -d -- *.sqfs *.sqdelta \
--output sha512sum.txt.tmp \
/dev/stdin
mv sha512sum.txt.tmp sha512sum.txt
+date +ts-old-checksum-end=%s.%N
# NEW LOGIC, that tries to re-use signed checksums
# Helper func for signing.
@@ -197,6 +199,7 @@ sign_prefix() {
mv "${d}".tmp "${d}"
}
+date +ts-new-checksum-start=%s.%N
# 1. Create per-day checksums, with dates in the filenames; only if they do NOT
# exist.
find . -maxdepth 1 -mindepth 1 -name 'gentoo-*sqfs' -type f -printf '%f\n' \
@@ -249,5 +252,6 @@ find "$tempdir" -name 'gentoo-*combine-verified' \
--output "${tempdir}"/sha512sum.txt.tmp \
/dev/stdin
mv "${tempdir}"/{sha512sum.txt.tmp,sha512sum.txt}
-diff -Nuar sha512sum.txt "${tempdir}"/sha512sum.txt
-date +%s.%N
+diff -Nuar sha512sum.txt "${tempdir}"/sha512sum.txt || true
+date +ts-new-checksum-done=%s.%N
+date +ts-last=%s.%N