nowadays.
Fix some generated URLS
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 );
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
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
$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;
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) {
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 || '';
if ($opts->{exact}) {
$printed++;
- hint( "You have searched only for words exactly matching your keywords. You can try to search <a href=\"$SEARCH_CGI?exact=0;searchon=$searchon;suite=$suites_param;section=$sections_param;keywords=$keyword_esc;arch=$archs_param\">allowing subword matching</a>." );
+ hint( "You have searched only for words exactly matching your keywords. You can try to search <a href=\"$SEARCH_URL?exact=0;$opts->{common_params}\">allowing subword matching</a>." );
}
}
hint( ( $printed ? "Or you" : "You" )." can try a different search on the <a href=\"$SEARCH_PAGE#search_packages\">Packages search page</a>." );
map { $_->{$pkg}||{} } @func_args );
}
} elsif (@$pkgs_list) {
- $str .= "<p><a href=\"$SEARCH_URL/FIXME\">".
+ $str .= "<p><a href=\"$SEARCH_URL?exact=0;$opts->{common_params}\">".
($#{$pkgs_list}+1)."</a> results have not been displayed because you requested only exact matches.</p>";
}
$str .= '</div>';
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 {
$checked_searchon{names} = "checked=\"checked\""
if $values{searchon} eq 'default';
$search_in_header = <<MENU;
-<form method="GET" action="$SEARCH_CGI">
+<form method="GET" action="$SEARCH_URL">
<div id="hpacketsearch">
<input type="hidden" name="debug" value="$values{debug}">
<input type="hidden" name="suite" value="$values{suite}">
use strict;
use warnings;
-use CGI qw( -oldstyle_urls );
+use CGI;
use POSIX;
use HTML::Entities;
use DB_File;