From: Frank Lichtenheld Date: Tue, 21 Feb 2006 13:53:57 +0000 (+0000) Subject: remove $SEARCH_CGI since it is always identical with $SEARCH_URL X-Git-Tag: switch-to-templates~90 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=47c93cb066364b11f0b216589ddc68671435b060;p=deb%2Fpackages.git remove $SEARCH_CGI since it is always identical with $SEARCH_URL nowadays. Fix some generated URLS --- diff --git a/cgi-bin/dispatcher.pl b/cgi-bin/dispatcher.pl index 8d6fc16..3dca95c 100755 --- a/cgi-bin/dispatcher.pl +++ b/cgi-bin/dispatcher.pl @@ -19,8 +19,7 @@ use DB_File; use Benchmark ':hireswallclock'; use Deb::Versions; -use Packages::Config qw( $DBDIR $ROOT $SEARCH_CGI $SEARCH_PAGE - @SUITES @SECTIONS @ARCHIVES @ARCHITECTURES ); +use Packages::Config qw( $DBDIR $ROOT @SUITES @SECTIONS @ARCHIVES @ARCHITECTURES ); use Packages::CGI; use Packages::DB; use Packages::Search qw( :all ); diff --git a/config.sh b/config.sh index df7fae5..3e8b2c6 100644 --- a/config.sh +++ b/config.sh @@ -33,8 +33,6 @@ kfreebsd_ftpsite=http://kfreebsd-gnu.debian.net/debian root="" search_page="http://packages.debian.net/" -# FIXME: remove dupe -search_cgi="/search" search_url="/search" webmaster=webmaster@debian.org contact=debian-www@lists.debian.org diff --git a/lib/Packages/Config.pm b/lib/Packages/Config.pm index d2efe2f..73d3542 100644 --- a/lib/Packages/Config.pm +++ b/lib/Packages/Config.pm @@ -9,14 +9,14 @@ use Packages::CGI; our @ISA = qw( Exporter ); our ( $TOPDIR, $DBDIR, $ROOT, $HOME, $CONTACT_MAIL, $WEBMASTER_MAIL, - $SEARCH_PAGE, $SEARCH_CGI, $SEARCH_URL, + $SEARCH_PAGE, $SEARCH_URL, $SRC_SEARCH_URL, $CONTENTS_SEARCH_CGI, $CN_HELP_URL, $BUG_URL, $SRC_BUG_URL, $QA_URL, $DDPO_URL, @SUITES, @SECTIONS, @ARCHIVES, @ARCHITECTURES, %FTP_SITES ); our @EXPORT_OK = qw( $TOPDIR $DBDIR $ROOT $HOME $CONTACT_MAIL $WEBMASTER_MAIL - $SEARCH_PAGE $SEARCH_CGI $SEARCH_URL + $SEARCH_PAGE $SEARCH_URL $SRC_SEARCH_URL $CONTENTS_SEARCH_CGI $CN_HELP_URL $BUG_URL $SRC_BUG_URL $QA_URL $DDPO_URL @SUITES @SECTIONS @ARCHIVES @ARCHITECTURES @@ -39,7 +39,7 @@ sub init { $TOPDIR = $1 if /^\s*topdir="?([^\"]*)"?\s*$/o; $ROOT = $1 if /^\s*root="?([^\"]*)"?\s*$/o; $HOME = $1 if /^\s*home="?([^\"]*)"?\s*$/o; - $SEARCH_CGI = $1 if /^\s*search_cgi="?([^\"]*)"?\s*$/o; +# $SEARCH_CGI = $1 if /^\s*search_cgi="?([^\"]*)"?\s*$/o; $SEARCH_PAGE = $1 if /^\s*search_page="?([^\"]*)"?\s*$/o; $SEARCH_URL = $1 if /^\s*search_url="?([^\"]*)"?\s*$/o; $SRC_SEARCH_URL = $1 if /^\s*search_src_url="?([^\"]*)"?\s*$/o; diff --git a/lib/Packages/DoSearch.pm b/lib/Packages/DoSearch.pm index c90a46f..d8aa6d8 100644 --- a/lib/Packages/DoSearch.pm +++ b/lib/Packages/DoSearch.pm @@ -15,12 +15,14 @@ use Deb::Versions; use Packages::Search qw( :all ); use Packages::CGI; use Packages::DB; -use Packages::Config qw( $DBDIR $SEARCH_URL $SEARCH_CGI $SEARCH_PAGE +use Packages::Config qw( $DBDIR $SEARCH_URL $SEARCH_PAGE @SUITES @ARCHIVES $ROOT ); sub do_search { my ($params, $opts, $html_header, $menu, $page_content) = @_; + $Params::Search::too_many_hits = 0; + if ($params->{errors}{keywords}) { fatal_error( "keyword not valid or missing" ); } elsif (length($opts->{keywords}) < 2) { @@ -37,6 +39,7 @@ sub do_search { my $suites_param = join ',', @{$params->{values}{suite}{no_replace}}; my $sections_param = join ',', @{$params->{values}{section}{no_replace}}; my $archs_param = join ',', @{$params->{values}{arch}{no_replace}}; + $opts->{common_params} = "suite=$suites_param;section=$sections_param;keywords=$keyword_esc;searchon=$searchon;arch=$archs_param"; # for output my $keyword_enc = encode_entities $keyword || ''; @@ -123,7 +126,7 @@ sub do_search { if ($opts->{exact}) { $printed++; - hint( "You have searched only for words exactly matching your keywords. You can try to search allowing subword matching." ); + hint( "You have searched only for words exactly matching your keywords. You can try to search {common_params}\">allowing subword matching." ); } } hint( ( $printed ? "Or you" : "You" )." can try a different search on the Packages search page." ); @@ -243,7 +246,7 @@ sub print_packages { map { $_->{$pkg}||{} } @func_args ); } } elsif (@$pkgs_list) { - $str .= "

". + $str .= "

{common_params}\">". ($#{$pkgs_list}+1)." results have not been displayed because you requested only exact matches.

"; } $str .= ''; diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index 69d99dc..67d2028 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -15,7 +15,7 @@ use Deb::Versions; use Packages::Search qw( :all ); use Packages::CGI; use Packages::DB; -use Packages::Config qw( $DBDIR $SEARCH_URL $SEARCH_CGI $SEARCH_PAGE +use Packages::Config qw( $DBDIR $SEARCH_URL $SEARCH_PAGE @SUITES @ARCHIVES $ROOT ); sub do_search_contents { diff --git a/lib/Packages/HTML.pm b/lib/Packages/HTML.pm index d6d194b..9f019fb 100644 --- a/lib/Packages/HTML.pm +++ b/lib/Packages/HTML.pm @@ -382,7 +382,7 @@ sub header { $checked_searchon{names} = "checked=\"checked\"" if $values{searchon} eq 'default'; $search_in_header = < +
diff --git a/lib/Packages/Search.pm b/lib/Packages/Search.pm index 32ef1e2..887bc43 100644 --- a/lib/Packages/Search.pm +++ b/lib/Packages/Search.pm @@ -43,7 +43,7 @@ package Packages::Search; use strict; use warnings; -use CGI qw( -oldstyle_urls ); +use CGI; use POSIX; use HTML::Entities; use DB_File;