summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm/install.pm14
-rw-r--r--urpm/main_loop.pm8
2 files changed, 9 insertions, 13 deletions
diff --git a/urpm/install.pm b/urpm/install.pm
index bebcdd09..db15ae09 100644
--- a/urpm/install.pm
+++ b/urpm/install.pm
@@ -26,16 +26,14 @@ sub _hash_intersect_list {
\%h;
}
-#- prepare transaction.
sub prepare_transaction {
- my ($_urpm, $set, $list, $sources, $transaction_list, $transaction_sources) = @_;
+ my ($_urpm, $set, $list, $sources) = @_;
- foreach (0..$#$list) {
- $transaction_list->[$_] = _hash_intersect_list($list->[$_], $set->{upgrade});
- }
- foreach my $id (@{$set->{upgrade}}) {
- exists $sources->{$id} and $transaction_sources->{$id} = $sources->{$id};
- }
+ my @transaction_list = map {
+ _hash_intersect_list($_, $set->{upgrade});
+ } @$list;
+
+ \@transaction_list, _hash_intersect_list($sources, $set->{upgrade});
}
sub build_transaction_set_ {
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm
index 6f0d702f..790cdffd 100644
--- a/urpm/main_loop.pm
+++ b/urpm/main_loop.pm
@@ -83,19 +83,17 @@ my @errors;
my $exit_code = 0;
foreach my $set (@{$state->{transaction} || []}) {
- my $transaction_sources = {};
- my @transaction_list;
#- put a blank line to separate with previous transaction or user question.
print "\n" if $options{verbose} >= 0;
- #- prepare transaction...
- urpm::install::prepare_transaction($urpm, $set, $list, \%sources, \@transaction_list, $transaction_sources);
+ my ($transaction_list, $transaction_sources) =
+ urpm::install::prepare_transaction($urpm, $set, $list, \%sources);
#- first, filter out what is really needed to download for this small transaction.
my @error_sources;
urpm::get_pkgs::download_packages_of_distant_media($urpm,
- \@transaction_list,
+ $transaction_list,
$transaction_sources,
\@error_sources,
quiet => $options{verbose} < 0,