summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/args.pm6
-rw-r--r--urpm/select.pm19
2 files changed, 24 insertions, 1 deletions
diff --git a/urpm/args.pm b/urpm/args.pm
index adbb49d9..47dbb1e2 100644
--- a/urpm/args.pm
+++ b/urpm/args.pm
@@ -92,8 +92,12 @@ my %options_spec = (
'pre-clean!' => sub { $urpm->{options}{'pre-clean'} = $_[1] },
'post-clean!' => sub { $urpm->{options}{'post-clean'} = $_[1] },
'no-priority-upgrade' => sub {
- $urpm->{options}{'priority-upgrade'} = '';
+ #- keep this option which is passed by older urpmi.
+ #- since we can't know what the previous_priority_upgrade list was,
+ #- just use a rubbish value which will mean list has changed
+ $options{previous_priority_upgrade} = 'list_has_changed';
},
+ 'previous-priority-upgrade=s' => \$options{previous_priority_upgrade},
force => \$::force,
justdb => \$options{justdb},
replacepkgs => \$options{replacepkgs},
diff --git a/urpm/select.pm b/urpm/select.pm
index 0300395e..fd57be04 100644
--- a/urpm/select.pm
+++ b/urpm/select.pm
@@ -7,6 +7,25 @@ use urpm::util;
use urpm::sys;
use URPM;
+sub set_priority_upgrade_option {
+ my ($urpm, $previous) = @_;
+
+ exists $urpm->{options}{'priority-upgrade'} and return;
+
+ # comma-separated list of packages that should be installed first,
+ # and that trigger an urpmi restart
+ my $list = 'rpm,perl-URPM,perl-MDV-Distribconf,urpmi,meta-task,glibc';
+ if ($previous) {
+ if ($previous eq $list) {
+ $list = '';
+ $urpm->{log}(N("urpmi was restarted, and the list of priority packages did not change"));
+ } else {
+ $urpm->{log}(N("urpmi was restarted, and the list of priority packages did change: %s vs %s", $previous, $list));
+ }
+ }
+ $urpm->{options}{'priority-upgrade'} = $list;
+}
+
sub _findindeps {
my ($urpm, $found, $qv, $v, $caseinsensitive, $src) = @_;