aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-20 19:52:19 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-20 19:52:19 +0000
commitd600679cdaf402a0f97bbbd76e7fa04c06c5a37e (patch)
treee9e639aea1ad8e78d0b844812d677d361681458e
parent9572b39868a6f3dbe9bb34a15dc757bbd9fd823d (diff)
downloadrpmdrake-d600679cdaf402a0f97bbbd76e7fa04c06c5a37e.tar
rpmdrake-d600679cdaf402a0f97bbbd76e7fa04c06c5a37e.tar.gz
rpmdrake-d600679cdaf402a0f97bbbd76e7fa04c06c5a37e.tar.bz2
rpmdrake-d600679cdaf402a0f97bbbd76e7fa04c06c5a37e.tar.xz
rpmdrake-d600679cdaf402a0f97bbbd76e7fa04c06c5a37e.zip
(get_pkgs) only display latest updates, not all of them (mga#2258, mga#4534)
-rw-r--r--NEWS2
-rw-r--r--Rpmdrake/pkg.pm9
2 files changed, 7 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index b85f6c39..502c3804 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,6 @@
- fix a rare crash when some packages are installed twice (mga#4972)
+- rpmdrake:
+ o only display latest updates, not all of them (mga#2258, mga#4534)
Version 5.30 - 02 March 2012, Thierry Vignaud
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index c9aecfec..9e7f719a 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -510,15 +510,16 @@ sub get_pkgs {
$urpm->{rpmdrake_state} = $state; #- Don't forget it
$gurpm->progress($level = 0.7);
- my @installable_pkgs;
+ my %l;
reset_pbar_count(1);
foreach my $pkg (@{$urpm->{depslist}}) {
update_pbar($gurpm);
$pkg->flag_upgrade or next;
- my $name = $pkg->fullname;
- push @installable_pkgs, $name;
- $all_pkgs{$name} = { pkg => $pkg };
+ my $short_name = $pkg->name;
+ $l{$short_name} = $pkg if !$l{$short_name} || $l{$short_name}->compare($pkg);
}
+ my @installable_pkgs = map { my $n = $_->fullname; $all_pkgs{$n} = { pkg => $_ }; $n } values %l;
+ undef %l;
my @inactive_backports;
my @active_backports;