diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index 480fb7b2265..12a63fa9260 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -177,15 +177,15 @@ elif [[ "$oldHashAlgo" = "null" ]]; then fi case "$oldHashAlgo" in - # Lengths of hex-encoded hashes - sha256) hashLength=64 ;; - sha512) hashLength=128 ;; + # Choose a temporary hash for given algorithm. + # Not using all-zeroes hash, since that is sometimes + # used for clean-up when updating multi-source packages. + # Created by hashing “update-source-version” string. + sha256) tempHash=AzH1rZFqEH8sovZZfJykvsEmCedEZWigQFHWHl6/PdE= ;; + sha512) tempHash=KFj9Fvco4AuCgLJIGRnVzyssRf7VGP2oi5CkH6ADvj75ow3am3h8pxefOgQlO+i33Q/BBnG/ST/F7B/0BvWHxw== ;; *) die "Unhandled hash algorithm '$oldHashAlgo' in '$attr'!" ;; esac -# Make a temporary all-zeroes hash of $hashLength characters -tempHash=$(printf '%0*d' "$hashLength" 0) - if [[ -n "$sri" ]]; then # SRI hashes only support base64 # SRI hashes need to declare the hash type as part of the hash