aboutsummaryrefslogtreecommitdiffstats
path: root/URPM
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-09-12 13:06:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-09-12 13:06:14 +0000
commit80c7953e3bf9f5b31d0b763deaed09551db907b9 (patch)
tree179e09c991433bea725b2f65b7412dc647b48c70 /URPM
parentd506cdf4f182e29beef22b3c25b51cafce6e3637 (diff)
downloadperl-URPM-80c7953e3bf9f5b31d0b763deaed09551db907b9.tar
perl-URPM-80c7953e3bf9f5b31d0b763deaed09551db907b9.tar.gz
perl-URPM-80c7953e3bf9f5b31d0b763deaed09551db907b9.tar.bz2
perl-URPM-80c7953e3bf9f5b31d0b763deaed09551db907b9.tar.xz
perl-URPM-80c7953e3bf9f5b31d0b763deaed09551db907b9.zip
handle {size} in set_rejected()
Diffstat (limited to 'URPM')
-rw-r--r--URPM/Resolve.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm
index 446e3ad..a3e60dc 100644
--- a/URPM/Resolve.pm
+++ b/URPM/Resolve.pm
@@ -498,10 +498,12 @@ sub backtrack_selected_psel_keep {
$keep and push @{$state->{rejected}{$psel->fullname}{backtrack}{keep}}, @$keep;
}
-
+#- side-effects: $state->{rejected}
sub set_rejected {
my ($state, $pkg, %options) = @_;
+ my $newly_rejected = !$state->{rejected}{$pkg->fullname};
+
my $rv = $state->{rejected}{$pkg->fullname} ||= {};
#- keep track of what causes closure.
@@ -520,7 +522,12 @@ sub set_rejected {
and $rv->{$_} = $options{$_};
}
- $rv;
+ if ($newly_rejected) {
+ #- keep track of size of package which are finally removed.
+ $rv->{size} = $pkg->size;
+ }
+
+ $newly_rejected;
}
#- see resolve_rejected_ below
@@ -544,9 +551,6 @@ sub resolve_rejected_ {
set_rejected($state, $pkg, %options);
- #- keep track of size of package which are finally removed.
- $state->{rejected}{$pkg->fullname}{size} = $pkg->size;
-
while (my $cp = shift @pkgs_todo) {
#- close what requires this property, but check with selected package requiring old properties.
foreach my $n ($cp->provides_nosense) {
@@ -564,13 +568,12 @@ sub resolve_rejected_ {
with_db_unsatisfied_requires($urpm, $db, $state, $n, sub {
my ($p, @l) = @_;
- my $rv = set_rejected($state, $p, %options,
+ my $newly_rejected = set_rejected($state, $p, %options,
from => scalar $pkg->fullname,
why => { unsatisfied => \@l });
#- continue the closure unless already examined.
- exists $rv->{size} and return;
- $rv->{size} = $p->size;
+ $newly_rejected or return;
$p->pack_header; #- need to pack else package is no longer visible...
push @pkgs_todo, $p;