summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-09 02:44:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-09 02:44:38 +0000
commitf9f67da951cddf7554ab10fafe11f71fbd1b66e9 (patch)
treeb25680fd02c46f98790bb595e28ffdf3ed5bd8fd /perl-install
parent2b460c53a4cbc8f9541a2960952acff64c68d335 (diff)
downloaddrakx-f9f67da951cddf7554ab10fafe11f71fbd1b66e9.tar
drakx-f9f67da951cddf7554ab10fafe11f71fbd1b66e9.tar.gz
drakx-f9f67da951cddf7554ab10fafe11f71fbd1b66e9.tar.bz2
drakx-f9f67da951cddf7554ab10fafe11f71fbd1b66e9.tar.xz
drakx-f9f67da951cddf7554ab10fafe11f71fbd1b66e9.zip
remove redundant code
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/run_program.pm19
1 files changed, 8 insertions, 11 deletions
diff --git a/perl-install/run_program.pm b/perl-install/run_program.pm
index 5bfd0352a..c237d7214 100644
--- a/perl-install/run_program.pm
+++ b/perl-install/run_program.pm
@@ -120,17 +120,14 @@ sub raw {
$root and chroot $root;
chdir "/";
- if (ref $name) {
- unless (exec { $name->[0] } $name->[1], @args) {
- log::l("exec of $name->[0] failed: $!");
- c::_exit(128);
- }
- } else {
- unless (exec $name, @args) {
- log::l("exec of $name failed: $!");
- c::_exit(128);
- }
-
+ my $ok = ref $name ? do {
+ exec { $name->[0] } $name->[1], @args;
+ } : do {
+ exec $name, @args;
+ };
+ if (!$ok) {
+ log::l("exec of $str failed: $!");
+ c::_exit(128);
}
}