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:
parent
2f7e928f4e
commit
9c7f303255
|
@ -43,11 +43,10 @@ fi
|
||||||
# If we don't know the hash or a path with that hash doesn't exist,
|
# If we don't know the hash or a path with that hash doesn't exist,
|
||||||
# download the file and add it to the store.
|
# download the file and add it to the store.
|
||||||
if test -z "$finalPath"; then
|
if test -z "$finalPath"; then
|
||||||
tmpPath=/tmp/bzr-checkout-tmp-$$
|
tmpPath="$(mktemp -d "${TMPDIR:-/tmp}/bzr-checkout-tmp-XXXXXXXX")"
|
||||||
tmpFile=$tmpPath/$dstFile
|
trap "rm -rf \"$tmpPath\"" EXIT
|
||||||
mkdir $tmpPath
|
|
||||||
|
|
||||||
trap "rm -rf $tmpPath" EXIT
|
tmpFile="$tmpPath/$dstFile"
|
||||||
|
|
||||||
# Perform the checkout.
|
# Perform the checkout.
|
||||||
if test "$NIX_PREFETCH_BZR_LEAVE_DOT_BZR" != 1
|
if test "$NIX_PREFETCH_BZR_LEAVE_DOT_BZR" != 1
|
||||||
|
|
|
@ -237,11 +237,11 @@ else
|
||||||
# download the file and add it to the store.
|
# download the file and add it to the store.
|
||||||
if test -z "$finalPath"; then
|
if test -z "$finalPath"; then
|
||||||
|
|
||||||
tmpPath=/tmp/git-checkout-tmp-$$
|
tmpPath="$(mktemp -d "${TMPDIR:-/tmp}/git-checkout-tmp-XXXXXXXX")"
|
||||||
tmpFile=$tmpPath/git-export
|
trap "rm -rf \"$tmpPath\"" EXIT
|
||||||
mkdir $tmpPath $tmpFile
|
|
||||||
|
|
||||||
trap "rm -rf $tmpPath" EXIT
|
tmpFile="$tmpPath/git-export"
|
||||||
|
mkdir "$tmpFile"
|
||||||
|
|
||||||
# Perform the checkout.
|
# Perform the checkout.
|
||||||
clone_user_rev "$tmpFile" "$url" "$rev"
|
clone_user_rev "$tmpFile" "$url" "$rev"
|
||||||
|
|
|
@ -35,11 +35,10 @@ fi
|
||||||
# download the file and add it to the store.
|
# download the file and add it to the store.
|
||||||
if test -z "$finalPath"; then
|
if test -z "$finalPath"; then
|
||||||
|
|
||||||
tmpPath=/tmp/hg-checkout-tmp-$$
|
tmpPath="$(mktemp -d "${TMPDIR:-/tmp}/hg-checkout-tmp-XXXXXXXX")"
|
||||||
tmpArchive=$tmpPath/hg-archive
|
trap "rm -rf \"$tmpPath\"" EXIT
|
||||||
mkdir $tmpPath
|
|
||||||
|
|
||||||
trap "rm -rf $tmpPath" EXIT
|
tmpArchive="$tmpPath/hg-archive"
|
||||||
|
|
||||||
# Perform the checkout.
|
# Perform the checkout.
|
||||||
if [[ $url != /* ]]; then
|
if [[ $url != /* ]]; then
|
||||||
|
|
Loading…
Reference in a new issue