summaryrefslogtreecommitdiffstats
path: root/urpm/get_pkgs.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-03-26 20:20:33 +0000
committerThierry Vignaud <tv@mageia.org>2012-03-26 20:20:33 +0000
commitd37d61ba24a165394d3c56160824b96851667c47 (patch)
tree46c21779e161fa9e997180379b86d4927ac2b925 /urpm/get_pkgs.pm
parentae6e4c1d456cf490d0960e50b90eb762944814b2 (diff)
downloadurpmi-d37d61ba24a165394d3c56160824b96851667c47.tar
urpmi-d37d61ba24a165394d3c56160824b96851667c47.tar.gz
urpmi-d37d61ba24a165394d3c56160824b96851667c47.tar.bz2
urpmi-d37d61ba24a165394d3c56160824b96851667c47.tar.xz
urpmi-d37d61ba24a165394d3c56160824b96851667c47.zip
(selected2local_and_blists) prevent having duplicate packages in blists
(thus fixing downloading twice noarch packages on x86_64 with --download-all (mga#4867))
Diffstat (limited to 'urpm/get_pkgs.pm')
-rw-r--r--urpm/get_pkgs.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index 5887d3dd..5c69a525 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -108,6 +108,7 @@ sub selected2local_and_blists {
my @remaining_ids = sort { $a <=> $b } keys %id_map;
+ my %blists;
my @blists = map {
my $medium = $_;
my %pkgs;
@@ -117,8 +118,12 @@ sub selected2local_and_blists {
$medium->{start} <= $id && $id <= $medium->{end} or last;
shift @remaining_ids;
+ my $maped_id = $id_map{$id};
+ # no duplicate package (especially noarch ones, eg from 32 & 64 bit media):
+ next if $blists{$maped_id};
+ $blists{$maped_id} = 1;
my $pkg = $urpm->{depslist}[$id];
- $pkgs{$id_map{$id}} = $pkg;
+ $pkgs{$maped_id} = $pkg;
}
}
%pkgs ? { medium => $medium, pkgs => \%pkgs } : ();