summary refs log tree commit diff
path: root/maintainers
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2007-05-15 13:33:14 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2007-05-15 13:33:14 +0000
commit98be355b2af983dd36d498e6b4875a6e4904ff00 (patch)
treeba321edc757f91d6762b33a0b93074b8a87cc607 /maintainers
parent80efe94cd0095ebaa8902b4c02a8a359a96e4497 (diff)
downloadnixpkgs-98be355b2af983dd36d498e6b4875a6e4904ff00.tar
nixpkgs-98be355b2af983dd36d498e6b4875a6e4904ff00.tar.gz
nixpkgs-98be355b2af983dd36d498e6b4875a6e4904ff00.tar.bz2
nixpkgs-98be355b2af983dd36d498e6b4875a6e4904ff00.tar.lz
nixpkgs-98be355b2af983dd36d498e6b4875a6e4904ff00.tar.xz
nixpkgs-98be355b2af983dd36d498e6b4875a6e4904ff00.tar.zst
nixpkgs-98be355b2af983dd36d498e6b4875a6e4904ff00.zip
* Handle SHA-256 hashes.
svn path=/nixpkgs/trunk/; revision=8702
Diffstat (limited to 'maintainers')
-rwxr-xr-xmaintainers/scripts/evacuate-urls.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/maintainers/scripts/evacuate-urls.sh b/maintainers/scripts/evacuate-urls.sh
index 2263cf5115f..381632308cb 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