]> git.deb.at Git - deb/packages.git/commitdiff
parse-sources: Merge suffix db generation changes from parse-packages
authorFrank Lichtenheld <frank@lichtenheld.de>
Fri, 1 Feb 2008 01:07:06 +0000 (02:07 +0100)
committerFrank Lichtenheld <frank@lichtenheld.de>
Fri, 1 Feb 2008 01:08:23 +0000 (02:08 +0100)
bin/parse-sources

index da49d6ad4ede971f0955a6d6435c202c65eddeee..658e2c10daf60f8b3d9e31886c5e052bed62baf1 100755 (executable)
@@ -128,11 +128,10 @@ tie %source_postfixes_db, "DB_File", "$DBDIR/source_postfixes.db.new",
        or die "Error creating DB: $!";
 while (my ($k, $v) = each(%source_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_SOURCE_POSTFIXES) {
-               $v = "\001" . $nr;
+           $v = ($v =~ /\^/) ? "^\001" . $nr
+               : "\001" . $nr;
        }
        $source_postfixes_db{$k} = $v;
 }