From 6a91695cbe85fb81a4833ed3be293908a239e9c6 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 31 Aug 2012 16:44:55 +0000 Subject: (clean_trans_sources_from_src_packages) split it out of run() --- urpm/main_loop.pm | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'urpm/main_loop.pm') diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index 77ee4fef..c0ca6f0b 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -150,6 +150,16 @@ sub _install_src { } } +sub clean_trans_sources_from_src_packages { + my ($urpm, $transaction_sources_install, $transaction_sources) = @_; + foreach ($transaction_sources_install, $transaction_sources) { + foreach my $id (keys %$_) { + my $pkg = $urpm->{depslist}[$id] or next; + $pkg->arch eq 'src' and delete $_->{$id}; + } + } +} + sub _continue_on_error { my ($urpm, $callbacks, $msgs, $error_sources, $formatted_errors) = @_; my $go_on; @@ -375,12 +385,7 @@ sub run { next if $no_install; #- clean to remove any src package now. - foreach (\%transaction_sources_install, $transaction_sources) { - foreach my $id (keys %$_) { - my $pkg = $urpm->{depslist}[$id] or next; - $pkg->arch eq 'src' and delete $_->{$id}; - } - } + clean_trans_sources_from_src_packages($urpm, \%transaction_sources_install, $transaction_sources); #- install/remove other packages if (keys(%transaction_sources_install) || keys(%$transaction_sources) || $set->{remove}) { -- cgit v1.2.1