summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-12-13 15:30:09 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-12-13 15:30:09 +0000
commite27cf71d96b1cd6f571a3dd34e62dc7bb647ccda (patch)
tree7b99b752909e54867ddcf8b90b51e7492002a6ae
parent6835da23d036145775e54556bb36390aee1389c6 (diff)
downloadurpmi-e27cf71d96b1cd6f571a3dd34e62dc7bb647ccda.tar
urpmi-e27cf71d96b1cd6f571a3dd34e62dc7bb647ccda.tar.gz
urpmi-e27cf71d96b1cd6f571a3dd34e62dc7bb647ccda.tar.bz2
urpmi-e27cf71d96b1cd6f571a3dd34e62dc7bb647ccda.tar.xz
urpmi-e27cf71d96b1cd6f571a3dd34e62dc7bb647ccda.zip
Small code factorization
-rwxr-xr-xurpmi10
1 files changed, 5 insertions, 5 deletions
diff --git a/urpmi b/urpmi
index 500b79a7..1ca0cab4 100755
--- a/urpmi
+++ b/urpmi
@@ -643,8 +643,8 @@ foreach my $set (@{$state->{transaction} || []}) {
} else {
message(N("installing %s", join(' ', @packnames)));
}
- @{!$urpm->{options}{'allow-force'} && $set->{remove} || []} and
- message(N("removing %s", join(' ', @{!$urpm->{options}{'allow-force'} && $set->{remove} || []})));
+ my $to_remove = $urpm->{options}{'allow-force'} ? [] : ($set->{remove} || []);
+ @$to_remove and message(N("removing %s", "@$to_remove"));
log_it(scalar localtime, " ", join(' ', values %transaction_sources_install, values %transaction_sources), "\n");
$urpm->{log}("starting installing packages");
my %install_options_common = (
@@ -658,7 +658,7 @@ foreach my $set (@{$state->{transaction} || []}) {
noscripts => $urpm->{options}{noscripts},
);
my @l = $urpm->install(
- !$urpm->{options}{'allow-force'} && $set->{remove} || [],
+ $to_remove,
\%transaction_sources_install, \%transaction_sources,
'fork' => @{$state->{transaction} || []} > 1, #- fork if multiple transaction
%install_options_common,
@@ -676,7 +676,7 @@ foreach my $set (@{$state->{transaction} || []}) {
$force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or ++$nok, next;
$urpm->{log}("starting installing packages without deps");
@l = $urpm->install(
- !$urpm->{options}{'allow-force'} && $set->{remove} || [],
+ $to_remove,
\%transaction_sources_install, \%transaction_sources,
'fork' => @{$state->{transaction} || []} > 1, #- fork if multiple transaction
nodeps => 1,
@@ -693,7 +693,7 @@ foreach my $set (@{$state->{transaction} || []}) {
$force && $yesexpr, boolean => 1) =~ /[$yesexpr]/ or ++$nok, next;
$urpm->{log}("starting force installing packages without deps");
@l = $urpm->install(
- !$urpm->{options}{'allow-force'} && $set->{remove} || [],
+ $to_remove,
\%transaction_sources_install, \%transaction_sources,
'fork' => @{$state->{transaction} || []} > 1, #- fork if multiple transaction
nodeps => 1, force => 1,