summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-22 08:07:27 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-09-22 08:07:27 +0000
commit0114e90b9f3d60d3d6c9a75e72834f4b0893f999 (patch)
treefc0456127e14c03ee89a01c0fd9907fa37b8533b /perl-install/pkgs.pm
parent0b6c59b204b8572b6d36f46559b8a410d4382cee (diff)
downloaddrakx-backup-do-not-use-0114e90b9f3d60d3d6c9a75e72834f4b0893f999.tar
drakx-backup-do-not-use-0114e90b9f3d60d3d6c9a75e72834f4b0893f999.tar.gz
drakx-backup-do-not-use-0114e90b9f3d60d3d6c9a75e72834f4b0893f999.tar.bz2
drakx-backup-do-not-use-0114e90b9f3d60d3d6c9a75e72834f4b0893f999.tar.xz
drakx-backup-do-not-use-0114e90b9f3d60d3d6c9a75e72834f4b0893f999.zip
Don't read packages twice
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 56c89ed03..ac27e6a10 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -485,10 +485,22 @@ sub psUsingHdlist {
if ($m->{ignored}) {
log::l("ignoring packages in $hdlist");
} else {
+ my $nb_suppl_pkg_skipped = 0;
+ my $callback = sub {
+ my (undef, $p) = @_;
+ our %uniq_pkg_seen;
+ if ($uniq_pkg_seen{$p->fullname}++) {
+ log::l("skipping " . scalar $p->fullname);
+ ++$nb_suppl_pkg_skipped;
+ return 0;
+ } else {
+ return 1;
+ }
+ };
if (-s $newsf) {
- ($m->{start}, $m->{end}) = $packages->parse_synthesis($newsf);
+ ($m->{start}, $m->{end}) = $packages->parse_synthesis($newsf, callback => $callback);
} elsif (-s $newf) {
- ($m->{start}, $m->{end}) = $packages->parse_hdlist($newf, 1);
+ ($m->{start}, $m->{end}) = $packages->parse_hdlist($newf, callback => $callback);
} else {
delete $packages->{mediums}{$medium_name};
unlink $newf;
@@ -499,7 +511,7 @@ sub psUsingHdlist {
unlink $newf;
$o_fhdlist or unlink $newsf;
die "fatal: nothing read in hdlist or synthesis for $fakemedium" };
- log::l("read " . ($m->{end} - $m->{start} + 1) . " packages in $hdlist");
+ log::l("read " . ($m->{end} - $m->{start} + 1) . " packages in $hdlist, $nb_suppl_pkg_skipped skipped");
}
$m;
}