From ae50a68a01c8aa1448cd525436f6aa908ff596ba Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 1 Feb 2008 02:07:06 +0100 Subject: [PATCH] parse-sources: Merge suffix db generation changes from parse-packages --- bin/parse-sources | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; } -- 2.39.2