mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 05:31:22 +00:00
5c847a370a
the tree being fetched from a Subversion repository. The revision number is now optional (and defaults to HEAD). This makes `fetchsvn' more pure. First, a URL/revision tuple does not uniquely identify a file resource, since the repository itself might change. Second, `svn:external' attributes can cause arbitrary resources to be exported. A script `nix-prefetch-svn' has been provided to determine the hash of a URL. svn path=/nixpkgs/trunk/; revision=938
20 lines
347 B
Bash
20 lines
347 B
Bash
. $stdenv/setup
|
|
|
|
header "exporting $url (r$rev) into $out"
|
|
|
|
prefetch=$(dirname $out)/svn-checkout-tmp-$md5
|
|
echo $prefetch
|
|
if test -e "$prefetch"; then
|
|
mv $prefetch $out
|
|
else
|
|
svn export -r "$rev" "$url" $out
|
|
fi
|
|
|
|
actual=$(nix-hash $out)
|
|
if test "$actual" != "$md5"; then
|
|
echo "hash is $actual, expected $md5" >&2
|
|
exit 1
|
|
fi
|
|
|
|
stopNest
|