Use mktemp for tempdir creation in prefetchers.

This incorporates the following two commits from <nixpkgs>:

NixOS/nixpkgs@f83af95f8a
NixOS/nixpkgs@5e7a1cf955

Hydra was the original reason why I was fixing tempdir creation in the
first place. Seeing that Hydra ships its own versions of these scripts,
we need to patch them here as well.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig
2014-08-28 22:10:17 +02:00
committed by Eelco Dolstra
parent 2f7e928f4e
commit 9c7f303255
3 changed files with 10 additions and 12 deletions

View File

@ -237,11 +237,11 @@ else
# download the file and add it to the store.
if test -z "$finalPath"; then
tmpPath=/tmp/git-checkout-tmp-$$
tmpFile=$tmpPath/git-export
mkdir $tmpPath $tmpFile
tmpPath="$(mktemp -d "${TMPDIR:-/tmp}/git-checkout-tmp-XXXXXXXX")"
trap "rm -rf \"$tmpPath\"" EXIT
trap "rm -rf $tmpPath" EXIT
tmpFile="$tmpPath/git-export"
mkdir "$tmpFile"
# Perform the checkout.
clone_user_rev "$tmpFile" "$url" "$rev"