about summary refs log tree commit diff
path: root/scripts/nix-pull.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-04T18·58+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-04T18·58+0000
commitd98f750fd8de5a0546903061e94b9bda3f68681f (patch)
treec689b6225fdf0160091caf39c4c4770dbf787a12 /scripts/nix-pull.in
parent34427a7b43382215774b1a164fd784a0f7804d33 (diff)
* tmpnam() -> File::Temp::tempdir().
Diffstat (limited to 'scripts/nix-pull.in')
-rw-r--r--scripts/nix-pull.in11
1 files changed, 4 insertions, 7 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index c7c20fb9b7cc..c1382b442917 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -1,16 +1,13 @@
 #! @perl@ -w -I@libexecdir@/nix
 
 use strict;
-use POSIX qw(tmpnam);
+use File::Temp qw(tempdir);
 use readmanifest;
 
-my $tmpdir;
-do { $tmpdir = tmpnam(); }
-until mkdir $tmpdir, 0777;
+my $tmpDir = tempdir("nix-pull.XXXXXX", CLEANUP => 1, TMPDIR => 1)
+    or die "cannot create a temporary directory";
 
-my $manifest = "$tmpdir/manifest";
-
-END { unlink $manifest; rmdir $tmpdir; }
+my $manifest = "$tmpDir/manifest";
 
 my $binDir = $ENV{"NIX_BIN_DIR"};
 $binDir = "@bindir@" unless defined $binDir;