diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2007-09-12 14:57:57 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2007-09-12 14:57:57 +0000 |
commit | 8ad950845520ffb10eb8b6e73f42c3b7de528856 (patch) | |
tree | 5fef694314291d936af6c38fd9db9aecddf1ac28 /URPM | |
parent | eff70ab2db326e08eb4ccc73555c165d939e382d (diff) | |
download | perl-URPM-8ad950845520ffb10eb8b6e73f42c3b7de528856.tar perl-URPM-8ad950845520ffb10eb8b6e73f42c3b7de528856.tar.gz perl-URPM-8ad950845520ffb10eb8b6e73f42c3b7de528856.tar.bz2 perl-URPM-8ad950845520ffb10eb8b6e73f42c3b7de528856.tar.xz perl-URPM-8ad950845520ffb10eb8b6e73f42c3b7de528856.zip |
create _remove_rejected_from()
Diffstat (limited to 'URPM')
-rw-r--r-- | URPM/Resolve.pm | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/URPM/Resolve.pm b/URPM/Resolve.pm index c0d8778..36930db 100644 --- a/URPM/Resolve.pm +++ b/URPM/Resolve.pm @@ -499,6 +499,21 @@ sub backtrack_selected_psel_keep { } #- side-effects: $state->{rejected} +sub _remove_rejected_from { + my ($state, $fullname, $from_fullname) = @_; + + my $rv = $state->{rejected}{$fullname} or return; + exists $rv->{closure}{$from_fullname} or return; + delete $rv->{closure}{$from_fullname}; + if (%{$rv->{closure}}) { + 0; + } else { + delete $state->{rejected}{$fullname}; + 1; + } +} + +#- side-effects: $state->{rejected} sub _set_rejected_from { my ($state, $pkg, $from_pkg) = @_; @@ -1093,10 +1108,7 @@ sub disable_selected { while (my $fullname = shift @rejected_todo) { my @rejecteds = keys %{$state->{rejected}}; foreach (@rejecteds) { - exists $state->{rejected}{$_} && exists $state->{rejected}{$_}{closure}{$fullname} or next; - delete $state->{rejected}{$_}{closure}{$fullname}; - unless (%{$state->{rejected}{$_}{closure}}) { - delete $state->{rejected}{$_}; + if (_remove_rejected_from($state, $_, $fullname)) { push @rejected_todo, $_; } } |