summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-06 19:20:46 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-06 19:20:46 +0000
commitfe798025581578296bed1314302a562bc1076958 (patch)
tree799fd4ce804a1ee02f15c645bbc00d2b588e9a06 /urpm
parent4d5afd7fdc3f25182c6bf442f432842e51211d0e (diff)
downloadurpmi-fe798025581578296bed1314302a562bc1076958.tar
urpmi-fe798025581578296bed1314302a562bc1076958.tar.gz
urpmi-fe798025581578296bed1314302a562bc1076958.tar.bz2
urpmi-fe798025581578296bed1314302a562bc1076958.tar.xz
urpmi-fe798025581578296bed1314302a562bc1076958.zip
create _priority_upgrade_pkgs()
(this may be a little bit slower, but it is needed for next commit)
Diffstat (limited to 'urpm')
-rw-r--r--urpm/select.pm18
1 files changed, 10 insertions, 8 deletions
diff --git a/urpm/select.pm b/urpm/select.pm
index 50f6e657..00991511 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -262,17 +262,11 @@ sub resolve_dependencies {
);
}
- my @priority_upgrade;
-
if ($options{priority_upgrade} && !$options{rpmdb}) {
- @priority_upgrade = map {
- $urpm->packages_by_name($_);
- } split(/,/, $options{priority_upgrade});
-
#- first check if a priority_upgrade package is requested
#- (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) {
+ if (my @l = grep { $_->flag_upgrade } _priority_upgrade_pkgs($urpm, $options{priority_upgrade})) {
$need_restart = _resolve_priority_upgrades($urpm, $db, $state, $requested, \@l, %options);
}
}
@@ -282,7 +276,7 @@ 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) {
+ if (my @l = grep { $state->{selected}{$_->id} } _priority_upgrade_pkgs($urpm, $options{priority_upgrade})) {
$need_restart = _resolve_priority_upgrades($urpm, $db, $state, $state->{selected}, \@l, %options);
}
}
@@ -290,6 +284,14 @@ sub resolve_dependencies {
$need_restart;
}
+sub _priority_upgrade_pkgs {
+ my ($urpm, $priority_upgrade_string) = @_;
+
+ map {
+ $urpm->packages_by_name($_);
+ } split(/,/, $priority_upgrade_string);
+}
+
sub _resolve_priority_upgrades {
my ($urpm, $db, $state, $selected, $priority_pkgs, %options) = @_;