for my $archive (@ARCHIVES) {
print "Reading $archive/$suite...\n";
- if (!-d "$TOPDIR/archive/$archive/$suite/") {
+ my $suite_dir = "$TOPDIR/archive/$archive/$suite";
+ if (!-d $suite_dir) {
print "\tseems not to exist, skipping...\n";
next;
}
- open PKG, "zcat $TOPDIR/archive/$archive/$suite/$what/{,debian-installer/}binary-*/Packages.gz|";
+ open PKG, "zcat $suite_dir/$what/binary-*/Packages.gz $suite_dir/$what/debian-installer/binary-*/Packages.gz|";
while (<PKG>) {
next if /^\s*$/;
my $data = "";
foreach (@complete_tags) {
my ($facet, $tag) = split( /::/, $_, 2);
if ($tag =~ s/^\{(.+)\}$/$1/) {
+ warn "pkg=$data{package} tags=$data{tag}\n" unless $facet && $tag;
foreach (split( /,/, $tag )) {
push @tags, "${facet}::$_";
}
} else {
+ warn "pkg=$data{package} tags=$data{tag}\n" unless $facet && $tag;
push @tags, "${facet}::$tag";
}
}
or die "Error creating DB: $!";
while (my ($k, $v) = each(%package_postfixes)) {
$v =~ s/.$//s;
- my $nr = $v;
- $nr =~ s/[^\000]//g;
- $nr = length($nr) + 1; # < number of hits
+ my $nr = ($v =~ tr/\000/\000/) + 1;
if ($nr > $MAX_PACKAGE_POSTFIXES) {
- $v = "\001" . $nr;
+ $v = ($v =~ /\^/) ? "^\001" . $nr
+ : "\001" . $nr;
}
$package_postfixes_db{$k} = $v;
}