From d1fb1307958857890ec547e01bfc66ea6c72de04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Victor=20Duarte=20Martins?= Date: Tue, 6 Apr 2010 19:31:02 +0000 Subject: Bugfix update version 5.23.1 (bug #40556) --- Makefile | 2 +- NEWS | 4 ++++ Rpmdrake/gui.pm | 14 ++++++++++---- Rpmdrake/open_db.pm | 9 ++++++++- Rpmdrake/pkg.pm | 23 +++++++++++++++++------ 5 files changed, 40 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index f754b26d..f49f53d5 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION = 5.23 +VERSION = 5.23.1 NAME = rpmdrake DIRS = grpmi po data mime diff --git a/NEWS b/NEWS index 85540414..bf8a6e9e 100644 --- a/NEWS +++ b/NEWS @@ -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 }; } -- cgit v1.2.1