From 7f12a73d7c071e6625462d3867626ba00f283d2d Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 3 Jul 2008 08:50:40 +0000 Subject: factorize code --- urpme | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'urpme') diff --git a/urpme b/urpme index b0bd9ee6..acd81f3c 100644 --- a/urpme +++ b/urpme @@ -136,21 +136,16 @@ if ($options{auto}) { #- Warning : the following message is parsed in urpm::parallel_* print N("removing %s", join(' ', sort @toremove)) . "\n"; + +my %remove_options = ( + test => $test, + force => $force, + noscripts => $urpm->{options}{noscripts}, + repackage => $urpm->{options}{repackage}, +); my @errors = $parallel - ? urpm::parallel::remove($urpm, - \@toremove, - test => $test, - force => $force, - noscripts => $urpm->{options}{noscripts}, - repackage => $urpm->{options}{repackage}, - ) - : urpm::install::install($urpm, - \@toremove, {}, {}, - test => $test, - force => $force, - noscripts => $urpm->{options}{noscripts}, - repackage => $urpm->{options}{repackage}, - ); + ? urpm::parallel::remove($urpm, \@toremove, %remove_options) + : urpm::install::install($urpm, \@toremove, {}, {}, %remove_options); if (@errors) { #- Warning : the following message is parsed in urpm::parallel_* -- cgit v1.2.1