diff options
author | Michael Raskin <7c6f434c@mail.ru> | 2007-12-04 22:06:13 +0000 |
---|---|---|
committer | Michael Raskin <7c6f434c@mail.ru> | 2007-12-04 22:06:13 +0000 |
commit | 41ecc6941b49d2211d4215e4e6c9a496a179ada8 (patch) | |
tree | d53430d78f39218a1a65c03942b266884d20a3d6 /pkgs/build-support/fetchsvn | |
parent | 800634501b9f5f5666ca20148b544ec27a3965e5 (diff) | |
download | nixpkgs-41ecc6941b49d2211d4215e4e6c9a496a179ada8.tar nixpkgs-41ecc6941b49d2211d4215e4e6c9a496a179ada8.tar.gz nixpkgs-41ecc6941b49d2211d4215e4e6c9a496a179ada8.tar.bz2 nixpkgs-41ecc6941b49d2211d4215e4e6c9a496a179ada8.tar.lz nixpkgs-41ecc6941b49d2211d4215e4e6c9a496a179ada8.tar.xz nixpkgs-41ecc6941b49d2211d4215e4e6c9a496a179ada8.tar.zst nixpkgs-41ecc6941b49d2211d4215e4e6c9a496a179ada8.zip |
svn path=/nixpkgs/trunk/; revision=9861
Diffstat (limited to 'pkgs/build-support/fetchsvn')
-rw-r--r-- | pkgs/build-support/fetchsvn/builder.sh | 2 | ||||
-rw-r--r-- | pkgs/build-support/fetchsvn/default.nix | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/pkgs/build-support/fetchsvn/builder.sh b/pkgs/build-support/fetchsvn/builder.sh index d06efa88e29..b53ce95579a 100644 --- a/pkgs/build-support/fetchsvn/builder.sh +++ b/pkgs/build-support/fetchsvn/builder.sh @@ -12,7 +12,7 @@ fi # hash of the output matters. echo 'p' | svn export -r "$rev" "$url" $out -actual=$(nix-hash $out) +actual=$(nix-hash $out --type "$outputHashAlgo") if test "$actual" != "$outputHash"; then echo "hash is $actual, expected $outputHash" >&2 exit 1 diff --git a/pkgs/build-support/fetchsvn/default.nix b/pkgs/build-support/fetchsvn/default.nix index ff842b0ee24..ce6a1e61d9c 100644 --- a/pkgs/build-support/fetchsvn/default.nix +++ b/pkgs/build-support/fetchsvn/default.nix @@ -1,4 +1,5 @@ -{stdenv, subversion, nix, sshSupport ? false, openssh ? null}: {url, rev ? "HEAD", md5}: +{stdenv, subversion, nix, sshSupport ? false, openssh ? null}: +{url, rev ? "HEAD", md5 ? "", sha256 ? ""}: stdenv.mkDerivation { name = "svn-export"; @@ -6,11 +7,11 @@ stdenv.mkDerivation { buildInputs = [subversion nix]; # Nix <= 0.7 compatibility. - id = md5; + /*id = if sha256 == "" then md5 else sha256;*/ - outputHashAlgo = "md5"; + outputHashAlgo = if sha256=="" then "md5" else "sha256"; outputHashMode = "recursive"; - outputHash = md5; + outputHash = if sha256 =="" then md5 else sha256; inherit url rev sshSupport openssh; } |