diff options
author | João Victor Duarte Martins <jvictor@mandriva.com> | 2010-04-06 16:08:42 +0000 |
---|---|---|
committer | João Victor Duarte Martins <jvictor@mandriva.com> | 2010-04-06 16:08:42 +0000 |
commit | 1a933c854c9f5357e4898f5c5e56095aea0eb88a (patch) | |
tree | fc7454ad96a9ab9428025adfa654e404efe1655e /Rpmdrake | |
parent | 9a32f85aaef279ce534a9e5e63e12c50bfaeac3c (diff) | |
download | rpmdrake-1a933c854c9f5357e4898f5c5e56095aea0eb88a.tar rpmdrake-1a933c854c9f5357e4898f5c5e56095aea0eb88a.tar.gz rpmdrake-1a933c854c9f5357e4898f5c5e56095aea0eb88a.tar.bz2 rpmdrake-1a933c854c9f5357e4898f5c5e56095aea0eb88a.tar.xz rpmdrake-1a933c854c9f5357e4898f5c5e56095aea0eb88a.zip |
Fixes the inactive backports listing (#40556)
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/gui.pm | 14 | ||||
-rw-r--r-- | Rpmdrake/open_db.pm | 9 | ||||
-rw-r--r-- | Rpmdrake/pkg.pm | 23 |
3 files changed, 35 insertions, 11 deletions
diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index f54dea8a..41306f77 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -636,19 +636,25 @@ sub pkgs_provider { all => [ keys %$pkgs ], ); my %tmp_filter_methods = ( - all => sub { [ keys %$pkgs ] }, + all => sub { + [ difference2([ keys %$pkgs ], $h->{inactive_backports}) ] + }, all_updates => sub { # potential "updates" from media not tagged as updates: if (!$options{pure_updates} && !$Rpmdrake::pkg::need_restart) { [ @{$h->{updates}}, difference2([ grep { is_updatable($_) } @{$h->{installable}} ], $h->{backports}) ]; } else { - $h->{updates}; + [ difference2($h->{updates}, $h->{inactive_backports}) ]; } }, backports => sub { $h->{backports} }, - meta_pkgs => sub { $h->{meta_pkgs} }, - gui_pkgs => sub { $h->{gui_pkgs} }, + meta_pkgs => sub { + [ difference2($h->{meta_pkgs}, $h->{inactive_backports}) ] + }, + gui_pkgs => sub { + [ difference2($h->{gui_pkgs}, $h->{inactive_backports}) ] + }, ); foreach my $importance (qw(bugfix security normal)) { $tmp_filter_methods{$importance} = sub { diff --git a/Rpmdrake/open_db.pm b/Rpmdrake/open_db.pm index 315d06c4..888d0ffa 100644 --- a/Rpmdrake/open_db.pm +++ b/Rpmdrake/open_db.pm @@ -34,6 +34,7 @@ use feature 'state'; use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(fast_open_urpmi_db + get_backport_media get_inactive_backport_media get_update_medias is_it_a_devel_distro @@ -122,9 +123,15 @@ sub is_it_a_devel_distro { return $res; } +sub get_backport_media { + my ($urpm) = @_; + grep { $_->{name} =~ /backport/i && + $_->{name} !~ /debug|sources/i } @{$urpm->{media}}; +} + sub get_inactive_backport_media { my ($urpm) = @_; - map { $_->{name} } grep { $_->{ignore} && $_->{name} =~ /backport/i && $_->{name} !~ /debug|sources/i } @{$urpm->{media}}; + map { $_->{name} } grep { $_->{ignore} } get_backport_media($urpm); } sub get_update_medias { diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index 79bc7f7e..795a2ae6 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -495,9 +495,6 @@ sub get_pkgs { $urpm->{rpmdrake_state} = $state; #- Don't forget it $gurpm->progress($level = 0.7); - my @search_medias = grep { $_->{searchmedia} } @{$urpm->{media}}; - - my @backports; reset_pbar_count(1); foreach my $pkg (@{$urpm->{depslist}}) { update_pbar($gurpm); @@ -506,14 +503,27 @@ sub get_pkgs { push @installable_pkgs, $name; $all_pkgs{$name} = { pkg => $pkg }; } - foreach my $medium (@search_medias) { + + my @inactive_backports; + my @active_backports; + my @backport_medias = get_backport_media($urpm); + + foreach my $medium (@backport_medias) { update_pbar($gurpm); + + # The 'searchmedia' flag differentiates inactive backport medias + # (because that option was passed to urpm::media::configure to + # temporarily enable them) + + my $backports = + $medium->{searchmedia} ? \@inactive_backports : \@active_backports; + foreach my $pkg_id ($medium->{start} .. $medium->{end}) { next if !$pkg_id; my $pkg = $urpm->{depslist}[$pkg_id]; $pkg->flag_upgrade or next; my $name = urpm_name($pkg); - push @backports, $name; + push @$backports, $name; $all_pkgs{$name} = { pkg => $pkg }; } } @@ -543,7 +553,8 @@ sub get_pkgs { meta_pkgs => \@meta_pkgs, gui_pkgs => [ grep { member(($all_pkgs{$_}{pkg}->fullname)[0], @gui_pkgs) } keys %all_pkgs ], update_descr => $update_descr, - backports => \@backports, + backports => [ @inactive_backports, @active_backports ], + inactive_backports => \@inactive_backports }; } |