X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=cgi-bin%2Fdispatcher.pl;h=5ff3b675227236154e65da31e9ce4d510fcd016b;hb=416227e3eff75fb13c805ec723a414f54bc7c372;hp=99c547998e54ac98405383c8ec4190e62665fd63;hpb=e23d2d2080a904ddd6d989a878f3c9b164f0a075;p=deb%2Fpackages.git diff --git a/cgi-bin/dispatcher.pl b/cgi-bin/dispatcher.pl index 99c5479..5ff3b67 100755 --- a/cgi-bin/dispatcher.pl +++ b/cgi-bin/dispatcher.pl @@ -33,6 +33,7 @@ use Packages::DoSearch; use Packages::DoSearchContents; use Packages::DoShow; use Packages::DoIndex; +use Packages::DoNewPkg; use Packages::DoDownload; use Packages::DoFilelist; @@ -64,10 +65,10 @@ $Packages::CGI::debug = $debug; my $acc = I18N::AcceptLanguage->new(); my $http_lang = $acc->accepts( $input->http("Accept-Language"), - \@LANGUAGES ); + \@LANGUAGES ) || 'en'; debug( "LANGUAGES=@LANGUAGES header=". $input->http("Accept-Language"). - " http_lang=$http_lang", 2 ); + " http_lang=$http_lang", 2 ) if DEBUG; bindtextdomain ( 'pdo', $LOCALES ); textdomain( 'pdo' ); @@ -83,7 +84,7 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) { shift @components; $input->param( 'source', 1 ); } - if (@components > 1 and $components[0] eq 'search') { + if (@components > 0 and $components[0] eq 'search') { shift @components; $what_to_do = 'search'; # Done @@ -96,7 +97,7 @@ if (my $path = $input->path_info() || $input->param('PATH_INFO')) { } else { for ($components[-1]) { - /^(index|changelog|copyright|download|filelist)$/ && do { + /^(index|allpackages|newpkg|changelog|copyright|download|filelist)$/ && do { pop @components; $what_to_do = $1; last; @@ -171,7 +172,7 @@ my %params_def = ( keywords => { default => undef, match => '^([\w-]+)$', array => ',', var => \@archives, replace => { all => \@ARCHIVES, - default => [qw(us security non-US)]} }, + default => \@ARCHIVES} }, exact => { default => 0, match => '^(\w+)$', }, lang => { default => $http_lang, match => '^(\w+)$', }, source => { default => 0, match => '^(\d+)$', }, @@ -186,6 +187,8 @@ my %params_def = ( keywords => { default => undef, arch => { default => 'any', match => '^([\w-]+)$', array => ',', var => \@archs, replace => { any => \@ARCHITECTURES } }, + format => { default => 'html', match => '^(\w+)$', }, + mode => { default => undef, match => '^(\w+)$', }, ); my %opts; my %params = Packages::Search::parse_params( $input, \%params_def, \%opts );