summaryrefslogtreecommitdiffstats
path: root/urpm/select.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-06 19:14:47 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-06 19:14:47 +0000
commit1f9a9c8c51c8e2a205b2bdaae3706ed78d5b990c (patch)
tree4f78c49886939b832326b8df0d38037f91b604e2 /urpm/select.pm
parentc45cf0d96bb16d252285dcace2f5a70977e5748b (diff)
downloadurpmi-1f9a9c8c51c8e2a205b2bdaae3706ed78d5b990c.tar
urpmi-1f9a9c8c51c8e2a205b2bdaae3706ed78d5b990c.tar.gz
urpmi-1f9a9c8c51c8e2a205b2bdaae3706ed78d5b990c.tar.bz2
urpmi-1f9a9c8c51c8e2a205b2bdaae3706ed78d5b990c.tar.xz
urpmi-1f9a9c8c51c8e2a205b2bdaae3706ed78d5b990c.zip
move $resolve_priority_upgrades out of resolve_dependencies() into its own
function _resolve_priority_upgrades()
Diffstat (limited to 'urpm/select.pm')
-rw-r--r--urpm/select.pm38
1 files changed, 20 insertions, 18 deletions
diff --git a/urpm/select.pm b/urpm/select.pm
index 9582256e..c96b208a 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -263,20 +263,6 @@ sub resolve_dependencies {
}
my @priority_upgrade;
- my $resolve_priority_upgrades = sub {
- my ($selected, $priority_requested) = @_;
-
- my %priority_state;
-
- $urpm->resolve_requested__no_suggests_($db, \%priority_state, $priority_requested, %options);
- if (grep { ! exists $priority_state{selected}{$_} } keys %$priority_requested) {
- #- some packages which were selected previously have not been selected, strange!
- } elsif (grep { ! exists $priority_state{selected}{$_} } keys %$selected) {
- #- there are other packages to install after this priority transaction.
- %$state = %priority_state;
- $need_restart = 1;
- }
- };
if ($options{priority_upgrade} && !$options{rpmdb}) {
@priority_upgrade = map {
@@ -287,8 +273,7 @@ sub resolve_dependencies {
#- (it should catch all occurences in --auto-select mode)
#- (nb: a package "foo" may appear twice, and only one will be set flag_upgrade)
if (my @l = grep { $_->flag_upgrade } @priority_upgrade) {
- my %priority_requested = map { $_->id => undef } @l;
- $resolve_priority_upgrades->($requested, \%priority_requested);
+ _resolve_priority_upgrades($urpm, $db, $state, $requested, \@l, %options);
}
}
@@ -298,14 +283,31 @@ sub resolve_dependencies {
#- now check if a priority_upgrade package has been required
#- by a requested package
if (my @l = grep { $state->{selected}{$_->id} } @priority_upgrade) {
- my %priority_requested = map { $_->id => undef } @l;
- $resolve_priority_upgrades->($state->{selected}, \%priority_requested);
+ _resolve_priority_upgrades($urpm, $db, $state, $state->{selected}, \@l, %options);
}
}
}
$need_restart;
}
+sub _resolve_priority_upgrades {
+ my ($urpm, $db, $state, $selected, $priority_pkgs, %options) = @_;
+
+ my ($need_restart, %priority_state);
+
+ my %priority_requested = map { $_->id => undef } @$priority_pkgs;
+
+ $urpm->resolve_requested__no_suggests_($db, \%priority_state, \%priority_requested, %options);
+ if (grep { ! exists $priority_state{selected}{$_} } keys %priority_requested) {
+ #- some packages which were selected previously have not been selected, strange!
+ } elsif (grep { ! exists $priority_state{selected}{$_} } keys %$selected) {
+ #- there are other packages to install after this priority transaction.
+ %$state = %priority_state;
+ $need_restart = 1;
+ }
+ $need_restart;
+}
+
sub cooked_prefer {
my ($urpm, $cmdline_prefer) = @_;