From e2a592278c6518ed865f3f5c8aa73becae986330 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Tue, 7 Sep 2004 02:37:47 +0000 Subject: Skip packages that are found on a supplementary media but that are already provided by the main media. --- perl-install/pkgs.pm | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'perl-install/pkgs.pm') diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index c0105b055..f17c4cfd3 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -488,10 +488,35 @@ sub psUsingHdlist { if ($m->{ignored}) { log::l("ignoring packages in $hdlist"); } else { + our %uniq_pkg_seen; if (-s $newsf) { - ($m->{start}, $m->{end}) = $packages->parse_synthesis($newsf); + log::l("parse_synthesis"); + ($m->{start}, $m->{end}) = $packages->parse_synthesis( + $newsf, + callback => sub { + my (undef, $p) = @_; + if ($uniq_pkg_seen{$p->fullname}++) { + log::l("skipping " . scalar $p->fullname); + return 0; + } else { + return 1; + } + }, + ); } elsif (-s $newf) { - ($m->{start}, $m->{end}) = $packages->parse_hdlist($newf, 1); + log::l("parse_hdlist"); + ($m->{start}, $m->{end}) = $packages->parse_hdlist( + $newf, + callback => sub { + my (undef, $p) = @_; + if ($uniq_pkg_seen{$p->fullname}++) { + log::l("skipping " . scalar $p->fullname); + return 0; + } else { + return 1; + } + }, + ); } else { delete $packages->{mediums}{$medium_name}; unlink $newf; -- cgit v1.2.1