From 584e87663263b850c4a35247a762da1bf31cd90f Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 26 Mar 2012 18:21:38 +0000 Subject: (get_pkgs,get_updates_list) fix offering of updates from media not configured as update ones (inspirated by mdv) --- NEWS | 1 + Rpmdrake/open_db.pm | 1 - Rpmdrake/pkg.pm | 10 ++++++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index c1d8ab39..650cd61f 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ - rpmdrake: o display backported packages with a different icon + o fix offering of updates from media not configured as update ones Version 5.31 - 20 March 2012, Thierry Vignaud diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm index cd52e042..86b95be1 100644 --- a/Rpmdrake/open_db.pm +++ b/Rpmdrake/open_db.pm @@ -150,7 +150,6 @@ sub open_urpmi_db { my $urpm = fast_open_urpmi_db(); my $media = ref $::rpmdrake_options{media} ? join(',', @{$::rpmdrake_options{media}}) : ''; - # FIXME: this is bogus and pulls backports as updates: my $searchmedia = $urpmi_options{update} ? undef : join(',', get_inactive_backport_media($urpm)); $urpm->{lock} = urpm::lock::urpmi_db($urpm, undef, wait => $urpm->{options}{wait_lock}) if !$::env; my $previous = $::rpmdrake_options{'previous-priority-upgrade'}; diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 66b09b08..b8c8a690 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -375,12 +375,13 @@ our $need_restart; our $probe_only_for_updates; sub get_updates_list { - my ($urpm, $db, $state, $requested, $requested_list, $requested_strict, $all_pkgs) = @_; + my ($urpm, $db, $state, $requested, $requested_list, $requested_strict, $all_pkgs, %limit_preselect) = @_; $urpm->request_packages_to_upgrade( $db, $state, $requested, + %limit_preselect ); my %common_opts = ( @@ -500,7 +501,12 @@ sub get_pkgs { my (@requested, @requested_strict); if ($compute_updates->[0] || $::MODE eq 'update') { - get_updates_list($urpm, $db, $state, $requested, \@requested, \@requested_strict, \%all_pkgs); + my %filter; + if ($options{pure_updates}) { + # limit to packages from update-media (dependencies can still come from other media) + %filter = (idlist => [ map { $_->{start} .. $_->{end} } @update_medias ]); + } + get_updates_list($urpm, $db, $state, $requested, \@requested, \@requested_strict, \%all_pkgs, %filter); } $priority_state = $need_restart ? $state : undef; -- cgit v1.2.1