From 0a355c0073563dd25b834c3024c0fb58bff85649 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 18 Jul 2006 12:00:38 +0000 Subject: [PATCH] * Don't pollute /tmp. svn path=/nixpkgs/trunk/; revision=5769 --- pkgs/build-support/fetchsvn/nix-prefetch-svn | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/fetchsvn/nix-prefetch-svn b/pkgs/build-support/fetchsvn/nix-prefetch-svn index e8b849a1bbbe..cfefee70b030 100755 --- a/pkgs/build-support/fetchsvn/nix-prefetch-svn +++ b/pkgs/build-support/fetchsvn/nix-prefetch-svn @@ -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