summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-04-26 09:46:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-04-26 09:46:27 +0000
commit81e0cf5ae13264ce78af6c9747c99460b656e994 (patch)
treee3e877c1a6f84d0a4a9279e74b42474d48437d05 /perl-install/run_program.pm
parent9541b286f75c46dc38d0fe849e66b54b82a473f9 (diff)
downloaddrakx-81e0cf5ae13264ce78af6c9747c99460b656e994.tar
drakx-81e0cf5ae13264ce78af6c9747c99460b656e994.tar.gz
drakx-81e0cf5ae13264ce78af6c9747c99460b656e994.tar.bz2
drakx-81e0cf5ae13264ce78af6c9747c99460b656e994.tar.xz
drakx-81e0cf5ae13264ce78af6c9747c99460b656e994.zip
create ~/tmp when needed
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r--perl-install/run_program.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index eb6a0a533..5bfd0352a 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -58,8 +58,13 @@ sub raw {
}
$ENV{HOME} || $::isInstall or $ENV{HOME} = '/root';
- my $stdout = $stdout_raw && (ref($stdout_raw) ? "$ENV{HOME}/tmp/.drakx-stdout.$$" : "$root$stdout_raw");
- my $stderr = $stderr_raw && (ref($stderr_raw) ? "$ENV{HOME}/tmp/.drakx-stderr.$$" : "$root$stderr_raw");
+ my $tmpdir = sub {
+ my $dir = "$ENV{HOME}/tmp";
+ -d $dir or mkdir($dir, 0700);
+ $dir;
+ };
+ my $stdout = $stdout_raw && (ref($stdout_raw) ? $tmpdir->() . "/.drakx-stdout.$$" : "$root$stdout_raw");
+ my $stderr = $stderr_raw && (ref($stderr_raw) ? $tmpdir->() . "/.drakx-stderr.$$" : "$root$stderr_raw");
if (my $pid = fork()) {
if ($options->{detach}) {