From aa2039f5184d198062dbb61255c18d68c7c99bfb Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 24 Aug 2007 12:01:48 +0000 Subject: - fix split_length > 1 (eg: "urpmi --split-length 2 a b c" will only install 2 pkgs) (this bug has not been reported, just discovered it while reading the code) - cleanup --- NEWS | 2 ++ URPM/Resolve.pm | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 251917f..bc62bac 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ - allow running transaction with justdb option +- fix split_length > 1 + (eg: "urpmi --split-length 2 a b c" will only install 2 pkgs) Version 1.75 - 12 August 2007, by Pascal "Pixel" Rigaux diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index 0944bff..b3c7894 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -1290,10 +1290,10 @@ sub build_transaction_set { #- second step consists of re-applying resolve_requested in the same #- order computed in first step and to update a list of packages to #- install, to upgrade and to remove. - my (%requested, %examined); - foreach (@sorted) { - $requested{$_} = undef; - if (keys(%requested) >= $options{split_length}) { + my %examined; + while (@sorted) { + my @ids = splice(@sorted, 0, $options{split_length}); + my %requested = map { $_ => undef } @ids; $urpm->resolve_requested__no_suggests( $db, $state->{transaction_state} ||= {}, @@ -1302,7 +1302,6 @@ sub build_transaction_set { defined $options{start} ? (start => $options{start}) : @{[]}, defined $options{end} ? (end => $options{end}) : @{[]}, ); - %requested = (); my @upgrade = grep { ! exists $examined{$_} } keys %{$state->{transaction_state}{selected}}; my @remove = grep { $state->{transaction_state}{rejected}{$_}{removed} && @@ -1317,7 +1316,6 @@ sub build_transaction_set { $examined{$_} = undef foreach @upgrade, @remove; push @{$state->{transaction}}, { upgrade => \@upgrade, remove => \@remove }; - } } #- check that the transaction set has been correctly created. -- cgit v1.2.1