From 98be355b2af983dd36d498e6b4875a6e4904ff00 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 15 May 2007 13:33:14 +0000 Subject: [PATCH] * Handle SHA-256 hashes. svn path=/nixpkgs/trunk/; revision=8702 --- maintainers/scripts/evacuate-urls.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/maintainers/scripts/evacuate-urls.sh b/maintainers/scripts/evacuate-urls.sh index 2263cf5115f8..381632308cbd 100755 --- a/maintainers/scripts/evacuate-urls.sh +++ b/maintainers/scripts/evacuate-urls.sh @@ -16,8 +16,17 @@ find . -name "*.nix" | while read fn; do if test -e "$newPath"; then hash=$(fgrep -A 1 "$oldURL" "$fn" | grep md5 | sed 's^.*md5 = \"\(.*\)\";.*^\1^') + hashType=md5 + if test -z "$hash"; then + hash=$(fgrep -A 1 "$oldURL" "$fn" | grep sha256 | sed 's^.*sha256 = \"\(.*\)\";.*^\1^') + hashType="sha256 --base32" + if test -z "$hash"; then + echo "WARNING: cannot figure out the hash for $oldURL" + isSafe= + fi + fi echo "HASH = $hash" - if ! test "$(nix-hash --type md5 --flat "$newPath")" = "$hash"; then + if ! test "$(nix-hash --type $hashType --flat "$newPath")" = "$hash"; then echo "WARNING: $newPath exists and differs!" isSafe= fi