summaryrefslogtreecommitdiffstats
path: root/perl-install/run_program.pm
diff options
context:
space:
mode:
authorpad <pad@mandriva.com>1999-09-14 14:50:50 +0000
committerpad <pad@mandriva.com>1999-09-14 14:50:50 +0000
commit0aa7a9e98c3b51085c87aa13d61eef8e3f694626 (patch)
tree06c3462cb7af3adb37d3a4606dd43d2604b88eec /perl-install/run_program.pm
parent951e65ef820631665dbeddf6cfb43afce034efb9 (diff)
downloaddrakx-backup-do-not-use-0aa7a9e98c3b51085c87aa13d61eef8e3f694626.tar
drakx-backup-do-not-use-0aa7a9e98c3b51085c87aa13d61eef8e3f694626.tar.gz
drakx-backup-do-not-use-0aa7a9e98c3b51085c87aa13d61eef8e3f694626.tar.bz2
drakx-backup-do-not-use-0aa7a9e98c3b51085c87aa13d61eef8e3f694626.tar.xz
drakx-backup-do-not-use-0aa7a9e98c3b51085c87aa13d61eef8e3f694626.zip
*** empty log message ***
Diffstat (limited to 'perl-install/run_program.pm')
-rw-r--r--perl-install/run_program.pm19
1 files changed, 14 insertions, 5 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index 15394a1be..617c6ebd5 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -11,8 +11,8 @@ sub run($@) { rooted('', @_) }
sub rooted {
my ($root, $name, @args) = @_;
-
- log::l("running: $name @args" . ($root ? " with root $root" : ""));
+ my $str = ref $name ? $name->[0] : $name;
+ log::l("running: $str @args" . ($root ? " with root $root" : ""));
$root ? $root .= '/' : ($root = '');
fork and wait, return $? == 0;
@@ -25,9 +25,18 @@ sub rooted {
$root and chroot $root;
chdir "/";
- unless (exec $name, @args) {
- log::l("exec of $name failed: $!");
- exec('false') or exit(1);
+ if (ref $name) {
+ unless (exec { $name->[0] } $name->[1], @args) {
+ log::l("exec of $name->[0] failed: $!");
+ exec('false') or exit(1);
+ }
+ } else {
+ unless (exec $name, @args) {
+ log::l("exec of $name failed: $!");
+ exec('false') or exit(1);
+ }
+
}
}
+
}