aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-24 12:01:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-24 12:01:48 +0000
commitaa2039f5184d198062dbb61255c18d68c7c99bfb (patch)
tree9fa2e25600fd65008a7778941e9bd89bfa9c6568
parente9971cd9983768999b4ae9f54cb0c5d6434781e9 (diff)
downloadperl-URPM-aa2039f5184d198062dbb61255c18d68c7c99bfb.tar
perl-URPM-aa2039f5184d198062dbb61255c18d68c7c99bfb.tar.gz
perl-URPM-aa2039f5184d198062dbb61255c18d68c7c99bfb.tar.bz2
perl-URPM-aa2039f5184d198062dbb61255c18d68c7c99bfb.tar.xz
perl-URPM-aa2039f5184d198062dbb61255c18d68c7c99bfb.zip
- 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
-rw-r--r--NEWS2
-rw-r--r--URPM/Resolve.pm10
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.