X-Git-Url: https://git.deb.at/?p=deb%2Fpackages.git;a=blobdiff_plain;f=bin%2Fparse-sources;h=658e2c10daf60f8b3d9e31886c5e052bed62baf1;hp=5a9073a4620c17342060496a78631fcdddad1cba;hb=a9572ccb0c5930c582e93d901cc4e6d76cee0d45;hpb=11fd4b5f87f668eeb33922c6f64823e40828d137 diff --git a/bin/parse-sources b/bin/parse-sources index 5a9073a..658e2c1 100755 --- a/bin/parse-sources +++ b/bin/parse-sources @@ -2,8 +2,6 @@ # Convert Sources.gz files into Sleepycat db files for efficient usage of # data # -# $Id$ -# # Copyright (C) 2006 Jeroen van Wolffelaar # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +15,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. use strict; use lib './lib'; @@ -130,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; }