diff options
author | João Victor Duarte Martins <jvictor@mandriva.com> | 2010-04-06 19:31:02 +0000 |
---|---|---|
committer | João Victor Duarte Martins <jvictor@mandriva.com> | 2010-04-06 19:31:02 +0000 |
commit | d1fb1307958857890ec547e01bfc66ea6c72de04 (patch) | |
tree | ab09e9b401c2a436858c02151f534fdb7042d9e8 | |
parent | 7c77c389766f221d8e376375e448b38da121524e (diff) | |
download | rpmdrake-distro/mdv2010.0.tar rpmdrake-distro/mdv2010.0.tar.gz rpmdrake-distro/mdv2010.0.tar.bz2 rpmdrake-distro/mdv2010.0.tar.xz rpmdrake-distro/mdv2010.0.zip |
Bugfix update version 5.23.1 (bug #40556)distro/mdv2010.0
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | Rpmdrake/gui.pm | 14 | ||||
-rw-r--r-- | Rpmdrake/open_db.pm | 9 | ||||
-rw-r--r-- | Rpmdrake/pkg.pm | 23 |
5 files changed, 40 insertions, 12 deletions
@@ -1,4 +1,4 @@ -VERSION = 5.23 +VERSION = 5.23.1 NAME = rpmdrake DIRS = grpmi po data mime @@ -1,5 +1,9 @@ +Version 5.23.1 - 06 April 2010, João Victor Martins + - rpmdrake: o fix crashing when running as user (#55009) + o inactive backports are only listed in the "Backports" view (fixes + #40556) Version 5.23 - 27 October 2009, Thierry Vignaud diff --git a/Rpmdrake/gui.pm b/Rpmdrake/gui.pm index eea5ccf0..acacb9dc 100644 --- a/Rpmdrake/gui.pm +++ b/Rpmdrake/gui.pm @@ -558,19 +558,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 }; } |