From 2e8c8087347da018b0b490d102670fef2d99849c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 23 Mar 2011 14:51:21 +0000 Subject: [PATCH] Make `update-gcc.sh' more robust. svn path=/nixpkgs/branches/stdenv-updates/; revision=26468 --- pkgs/development/compilers/gcc-4.4/update-gcc.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/gcc-4.4/update-gcc.sh b/pkgs/development/compilers/gcc-4.4/update-gcc.sh index c93035296fc..1fb5a0c6e5b 100755 --- a/pkgs/development/compilers/gcc-4.4/update-gcc.sh +++ b/pkgs/development/compilers/gcc-4.4/update-gcc.sh @@ -36,11 +36,13 @@ do file="gcc-${component}-${version}.tar.bz2" url="${dir}/${file}" - path_and_hash="$(nix-prefetch-url "$url" 2>&1 | grep -E '^(hash|path) is')" - path="$(echo $path_and_hash | sed -e's/^.*path is \([^ ]\+\).*$/\1/g')" - hash="$(echo $path_and_hash | sed -e's/^.*hash is \([^ ]\+\).*$/\1/g')" + rm -f "${file}" - rm -f "${url}.sig" + wget "$url" + hash="$(nix-hash --flat --type sha256 "$file")" + path="$(nix-store --add-fixed sha256 "$file")" + + rm -f "${file}" "${file}.sig" wget "${url}.sig" gpg --verify "${file}.sig" "${path}" rm "${file}.sig"