summary refs log tree commit diff
path: root/pkgs/build-support/fetchhg
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-08-27 10:48:26 +0200
committeraszlig <aszlig@redmoonstudios.org>2014-08-27 11:22:34 +0200
commit5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801 (patch)
treeb3ada0f0cc17f855b02747ea4b2b8ed7d21b9395 /pkgs/build-support/fetchhg
parentdf3006679071421d57af4cfdcc53cee07b3157d6 (diff)
downloadnixpkgs-5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801.tar
nixpkgs-5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801.tar.gz
nixpkgs-5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801.tar.bz2
nixpkgs-5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801.tar.lz
nixpkgs-5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801.tar.xz
nixpkgs-5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801.tar.zst
nixpkgs-5e7a1cf955e43e1fa3c1c157c0d6961e1bcf9801.zip
build-support: Fix nix-prefetch-* on OS X.
Fixes a regression on OS X introduced by f83af95.

Don't use --tmpdir for mktemp, because that flag doesn't exist on OS X.
However, using -t is deprecated in GNU coreutils, so as suggested by
@ip1981 we're now using parameter expansion on ${TMPDIR:-/tmp} to
provide /tmp as a fallback if TMPDIR is not set and use it instead.

Also use this approach for nix-prefetch-cvs now in order to stay
consistent.

Reported-by: Vladimir Kirillov <proger@wilab.org.ua>
Tested-by: Igor Pashev <pashev.igor@gmail.com>
Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/build-support/fetchhg')
-rwxr-xr-xpkgs/build-support/fetchhg/nix-prefetch-hg2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchhg/nix-prefetch-hg b/pkgs/build-support/fetchhg/nix-prefetch-hg
index 7d4c0c8d741..a8916176f8a 100755
--- a/pkgs/build-support/fetchhg/nix-prefetch-hg
+++ b/pkgs/build-support/fetchhg/nix-prefetch-hg
@@ -35,7 +35,7 @@ fi
 # download the file and add it to the store.
 if test -z "$finalPath"; then
 
-    tmpPath="$(mktemp --tmpdir -d hg-checkout-tmp-XXXXXXXX)"
+    tmpPath="$(mktemp -d "${TMPDIR:-/tmp}/hg-checkout-tmp-XXXXXXXX")"
     trap "rm -rf \"$tmpPath\"" EXIT
 
     tmpArchive="$tmpPath/hg-archive"