]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
download-rust-crate: Switch from MD5 to BLAKE2
authorPeter Müller <peter.mueller@ipfire.org>
Mon, 2 May 2022 20:26:46 +0000 (20:26 +0000)
committerPeter Müller <peter.mueller@ipfire.org>
Mon, 2 May 2022 20:26:46 +0000 (20:26 +0000)
https://wiki.ipfire.org/devel/telco/2022-05-02

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
tools/download-rust-crate

index bae6b60bed0738207ceebaa3b5e5df7f9196622e..f6a0fe035d30fdbddaa843ccac45251b0049088a 100755 (executable)
@@ -50,8 +50,8 @@ main() {
        fi
 
        # Hash the downloaded file
-       local md5sum="$(md5sum "${download}" | awk '{ print $1 }')"
-       if [ -z "${md5sum}" ]; then
+       local b2sum="$(b2sum "${download}" | awk '{ print $1 }')"
+       if [ -z "${b2sum}" ]; then
                echo "${0}: Could not hash download" >&2
                unlink "${download}"
                return 1
@@ -73,7 +73,7 @@ main() {
        sed < "${RUST_TEMPLATE}" > "lfs/rust-${name}" \
                -e "s/^VER.*/VER        = ${version}/" \
                -e "s/^THISAPP.*/THISAPP    = ${name}-\$(VER)/" \
-               -e "s/^\$(DL_FILE)_MD5.*/\$(DL_FILE)_MD5 = ${md5sum}/"
+               -e "s/^\$(DL_FILE)_BLAKE2.*/\$(DL_FILE)_BLAKE2 = ${b2sum}/"
 
        echo "Done"
        return 0