diff options
-rwxr-xr-x | create-squashfs-snapshot | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/create-squashfs-snapshot b/create-squashfs-snapshot index 8989d46..aa4bc4e 100755 --- a/create-squashfs-snapshot +++ b/create-squashfs-snapshot @@ -26,6 +26,7 @@ shopt -s nullglob set -e -x +date +%s.%N # == config == # filled with gentoo-specific details, change at will @@ -163,8 +164,10 @@ done # create checksums for snapshot and deltas # OLD LOGIC, that scans entire 18GB -sha512sum -- *.sqfs *.sqdelta | \ - gpg \ +ls -d -- *.sqfs *.sqdelta \ +| xargs sha512sum -- \ +| sort -k +2 \ +| gpg \ --batch \ --yes \ -u "${signkeyid}" \ @@ -198,6 +201,7 @@ sign_prefix() { # exist. find . -maxdepth 1 -mindepth 1 -name 'gentoo-*sqfs' -type f -printf '%f\n' \ | cut -d. -f1 \ +| sort \ | uniq \ | perl -lne 'print $_ unless -e $_.".sha512sum.txt"' \ | while read -r _prefix ; do @@ -234,8 +238,8 @@ done # 4. Combine the verified files and sign the combined output. find "$tempdir" -name 'gentoo-*combine-verified' \ - | sort \ | xargs --no-run-if-empty cat \ + | sort -k +2 \ | gpg \ --batch \ --yes \ @@ -246,3 +250,4 @@ find "$tempdir" -name 'gentoo-*combine-verified' \ /dev/stdin mv "${tempdir}"/{sha512sum.txt.tmp,sha512sum.txt} diff -Nuar sha512sum.txt "${tempdir}"/sha512sum.txt +date +%s.%N |