X-Git-Url: https://git.deb.at/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fparse-packages;h=399a62ca060656a82314f4f80000a7462899b938;hb=fcd2a8e03040589f3048e91737d4b2863c8521fd;hp=38c83e988fbfcc8e890d44a30bbe47b5030c5708;hpb=3210a2b7d904e95b48ebbd84afa2bf1875544e8e;p=deb%2Fpackages.git diff --git a/bin/parse-packages b/bin/parse-packages index 38c83e9..399a62c 100755 --- a/bin/parse-packages +++ b/bin/parse-packages @@ -22,6 +22,8 @@ use strict; use lib './lib'; +$| = 1; + my $what = $ARGV[0] ? "non-free" : "*"; # max. distinct results for a given package postfix my $MAX_PACKAGE_POSTFIXES = 100; @@ -184,8 +186,13 @@ tie %descriptions_db, "DB_File", "$DBDIR/descriptions.db.new", open DESCR, ">", "$DBDIR/descriptions.txt" or die "Error creating descriptions textfile"; for (my $i=1; $i<= $#descriptions; $i++) { my $plain_description = $descriptions[$i]; - $plain_description =~ s/\n .\n/ /og; - $plain_description =~ s/[\n \t]+/ /og; +# WARNING: This needs to correspond with what happens in +# Packages/Search.pm:do_fulltext_search + $plain_description =~ tr [A-Z] [a-z]; + # ensure one space on both ends + $plain_description = " $plain_description "; + $plain_description =~ s/[(),.-]+//og; + $plain_description =~ s#[^a-z0-9_/+]+# #og; print DESCR "$plain_description\n"; $descriptions_db{$i} = $descriptions[$i]; }