]> git.deb.at Git - deb/packages.git/blobdiff - cgi-bin/dispatcher.pl
Use exact wallclocktime when available (it's in the 'perl' package)
[deb/packages.git] / cgi-bin / dispatcher.pl
index f967fd379a2fc704201428d307e93b6c53b41100..f03c55970aee3ebc5cd4d6e3702d30a3dc026fad 100755 (executable)
@@ -16,7 +16,7 @@ use POSIX;
 use URI::Escape;
 use HTML::Entities;
 use DB_File;
-use Benchmark;
+use Benchmark ':hireswallclock';
 
 use Deb::Versions;
 use Packages::Config qw( $DBDIR $ROOT $SEARCH_CGI $SEARCH_PAGE
@@ -28,6 +28,7 @@ use Packages::HTML ();
 use Packages::Sections;
 
 use Packages::DoSearch;
+use Packages::DoSearchContents;
 use Packages::DoShow;
 use Packages::DoDownload;
 use Packages::DoFilelist;
@@ -57,7 +58,7 @@ $Packages::CGI::debug = $debug;
 
 my $what_to_do = 'show';
 my $source = 0;
-if (my $path = $input->path_info()) {
+if (my $path = $input->path_info() || $input->param('PATH_INFO')) {
     my @components = grep { $_ } map { lc $_ } split /\/+/, $path;
 
     debug( "components[0]=$components[0]", 2 );
@@ -151,7 +152,7 @@ my %params_def = ( keywords => { default => undef,
                                    match => '^([\w-]+)$',
                                    array => ',', var => \@archives,
                                    replace => { all => \@ARCHIVES,
-                                            default => [qw(us security non-US)]} },
+                                                default => [qw(us security non-US)]} },
                   exact => { default => 0, match => '^(\w+)$',  },
                   source => { default => 0, match => '^(\d+)$',  },
                   searchon => { default => 'names', match => '^(\w+)$', },
@@ -162,7 +163,7 @@ my %params_def = ( keywords => { default => undef,
                   subsection => { default => 'default', match => '^([\w-]+)$',
                                   array => ',', var => \@subsections,
                                   replace => { default => [] } },
-                  arch => { default => 'any', match => '^(\w+)$',
+                  arch => { default => 'any', match => '^([\w-]+)$',
                             array => ',', var => \@archs, replace =>
                             { any => \@ARCHITECTURES } },
                   );
@@ -179,6 +180,11 @@ if ((($opts{searchon} eq 'names') && $opts{source}) ||
     $opts{source} = 1;
     $opts{searchon} = 'names',
     $opts{searchon_form} = 'sourcenames';
+} else {
+    $opts{searchon_form} = $opts{searchon};
+}
+if ($opts{searchon} eq 'contents' or $opts{searchon} eq 'filenames') {
+    $what_to_do = 'search_contents';
 }
 
 my $pet1 = new Benchmark;