diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/pkgs.pm | 29 |
1 files changed, 27 insertions, 2 deletions
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; |