]> git.deb.at Git - deb/packages.git/blobdiff - bin/parse-packages
Merge commit 'alioth/ubuntu-master' into ubuntu-master
[deb/packages.git] / bin / parse-packages
index 2e713c6fbd93a596f19f853148ba1af21efcaeff..15eae16c5fac1fe92eae311a28ff610f6fc673c0 100755 (executable)
@@ -68,11 +68,12 @@ for my $suite (@SUITES) {
 
     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 = "";
@@ -336,11 +337,10 @@ tie %package_postfixes_db, "DB_File", "$DBDIR/package_postfixes.db.new",
        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;
 }