* Don't pollute /tmp.

svn path=/nixpkgs/trunk/; revision=5769
This commit is contained in:
Eelco Dolstra 2006-07-18 12:00:38 +00:00
parent 38420dfd6f
commit 0a355c0073

View file

@ -36,11 +36,12 @@ fi
# download the file and add it to the store.
if test -z "$finalPath"; then
# !!! race? should be relatively safe, `svn export' barfs if $tmpPath exists.
tmpPath=/tmp/svn-checkout-tmp-$$
tmpFile=$tmpPath/svn-export
mkdir $tmpPath
trap "rm -rf $tmpPath" EXIT
# Perform the checkout.
# !!! remove 2>/dev/null when we have fixed the certificate hackery.
echo p | svn export -r "$rev" "$url" $tmpFile 2>/dev/null >&2
@ -52,8 +53,6 @@ if test -z "$finalPath"; then
# Add the downloaded file to the Nix store.
finalPath=$(nix-store --add-fixed --recursive "$hashType" $tmpFile)
if test -n "$tmpPath"; then rm -rf $tmpPath || true; fi
if test -n "$expHash" -a "$expHash" != "$hash"; then
echo "hash mismatch for URL \`$url'"
exit 1