From e27cf71d96b1cd6f571a3dd34e62dc7bb647ccda Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 13 Dec 2005 15:30:09 +0000 Subject: Small code factorization --- urpmi | 10 +++++----- 1 file 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, -- cgit v1.2.1