From: Frank Lichtenheld Date: Fri, 1 Feb 2008 01:07:06 +0000 (+0100) Subject: parse-sources: Merge suffix db generation changes from parse-packages X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=ae50a68a01c8aa1448cd525436f6aa908ff596ba;p=deb%2Fpackages.git parse-sources: Merge suffix db generation changes from parse-packages --- diff --git a/bin/parse-sources b/bin/parse-sources index da49d6a..658e2c1 100755 --- a/bin/parse-sources +++ b/bin/parse-sources @@ -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; }