if (my $path = $input->path_info() || $input->param('PATH_INFO')) {
my @components = grep { $_ } map { lc $_ } split /\/+/, $path;
- push @components, 'index' if $path =~ m,/$,;
+ push @components, 'index' if @components && $path =~ m,/$,;
my %LANGUAGES = map { $_ => 1 } @LANGUAGES;
if (@components > 0 and $LANGUAGES{$components[0]}) {
my %params_set;
sub set_param_once {
my ($cgi, $params_set, $key, $val) = @_;
+ debug("set_param_once key=$key val=$val",4) if DEBUG;
if ($params_set->{$key}++) {
fatal_error( sprintf( _g( "%s set more than once in path" ), $key ) );
} else {
foreach (reverse @components) {
$need_pkg = !@pkg
&& ($what_to_do !~ /^(index|allpackages|newpkg)$/);
+ debug("need_pkg=$need_pkg component=$_",4) if DEBUG;
if (!$need_pkg && $SUITES{$_}) {
set_param_once( $input, \%params_set, 'suite', $_);
} elsif (!$need_pkg && (my $s = $SUITES_ALIAS{$_})) {
set_param_once( $input, \%params_set, 'archive', $_);
} elsif (!$need_pkg && $sections_descs{$_}) {
set_param_once( $input, \%params_set, 'subsection', $_);
+ } elsif (!$need_pkg && ($_ eq 'non-us')) { # non-US hack
+ set_param_once( $input, \%params_set, 'subsection', 'non-US');
} elsif (!$need_pkg && ($_ eq 'source')) {
set_param_once( $input, \%params_set, 'source', 1);
} elsif ($ARCHITECTURES{$_}) {
my ( $pkg, @suites, @sections, @subsections, @archives, @archs );
my %params_def = ( keywords => { default => undef,
- match => '^\s*([-+\@\s\w\/.:]+)\s*$',
+ array => '\s+',
+ match => '^([-+\@\w\/.:]+)$',
},
package => { default => undef,
match => '^([\w.+-]+)$',
var => \$pkg },
- suite => { default => 'all', match => '^([\w-]+)$',
+ suite => { default => 'default', match => '^([\w-]+)$',
array => ',', var => \@suites,
- replace => { all => \@SUITES } },
+ replace => { all => \@SUITES,
+ default => \@SUITES } },
archive => { default => ($what_to_do eq 'search') ?
'all' : 'default',
match => '^([\w-]+)$',
arch => { default => 'any', match => '^([\w-]+)$',
array => ',', var => \@archs, replace =>
{ any => \@ARCHITECTURES } },
- format => { default => 'html', match => '^(\w+)$', },
+ format => { default => 'html', match => '^([\w.]+)$', },
mode => { default => undef, match => '^(\w+)$', },
);
my %opts;
if DEBUG;
my $trailer = Packages::HTML::trailer( $ROOT );
-$trailer =~ s/LAST_MODIFIED_DATE/gmtime()/e; #FIXME
print $trailer;
# vim: ts=8 sw=4