1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

* tmpnam() -> File::Temp::tempdir().

This commit is contained in:
Eelco Dolstra 2006-10-04 18:58:11 +00:00
parent 34427a7b43
commit d98f750fd8
7 changed files with 41 additions and 53 deletions

View file

@ -1,7 +1,7 @@
#! @perl@ -w
use strict;
use POSIX qw(tmpnam);
use File::Temp qw(tempdir);
sub usageError {
@ -65,10 +65,8 @@ if ($interactive && !defined $ENV{"NIX_HAVE_TERMINAL"}) {
}
my $tmpDir;
do { $tmpDir = tmpnam(); }
until mkdir $tmpDir, 0777;
END { if (defined $tmpDir) { my $x = $?; system("@coreutils@/rm", "-rf", $tmpDir); $? = $x; } }
my $tmpDir = tempdir("nix-install-package.XXXXXX", CLEANUP => 1, TMPDIR => 1)
or die "cannot create a temporary directory";
sub barf {