From: Frank Lichtenheld Date: Fri, 3 Mar 2006 14:16:13 +0000 (+0000) Subject: Fix some smaller issues reported by Thijs Kinkhorst X-Git-Tag: switch-to-templates~10 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=06c6f30bfc4f55cecc7485fef0f0a227e32b44f0;p=deb%2Fpackages.git Fix some smaller issues reported by Thijs Kinkhorst --- diff --git a/cgi-bin/dispatcher.pl b/cgi-bin/dispatcher.pl index 86bb489..04d5acb 100755 --- a/cgi-bin/dispatcher.pl +++ b/cgi-bin/dispatcher.pl @@ -77,7 +77,7 @@ my $source = 0; 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]}) { @@ -281,7 +281,6 @@ print "Total page evaluation took ".timestr($tetd)."
" if DEBUG; my $trailer = Packages::HTML::trailer( $ROOT ); -$trailer =~ s/LAST_MODIFIED_DATE/gmtime()/e; #FIXME print $trailer; # vim: ts=8 sw=4 diff --git a/lib/Packages/DoFilelist.pm b/lib/Packages/DoFilelist.pm index 6bdfca7..a1dda56 100644 --- a/lib/Packages/DoFilelist.pm +++ b/lib/Packages/DoFilelist.pm @@ -43,7 +43,7 @@ sub do_filelist { my $arch = $opts->{arch}[0] ||''; %$html_header = ( title => sprintf( _g( "Filelist of package %s in %s of architecture %s" ), $pkg, $suite, $arch ), - title_tag => sprintf( _g( "Filelist of of package %s/%s/%s" ), $pkg, $suite, $arch ), + title_tag => sprintf( _g( "Filelist of package %s/%s/%s" ), $pkg, $suite, $arch ), lang => $opts->{lang}, keywords => "debian, $suite, $arch, filelist", print_title => 1, diff --git a/lib/Packages/DoSearch.pm b/lib/Packages/DoSearch.pm index 5b41162..f8782b1 100644 --- a/lib/Packages/DoSearch.pm +++ b/lib/Packages/DoSearch.pm @@ -28,6 +28,7 @@ sub do_search { if ($params->{errors}{keywords}) { fatal_error( _g( "keyword not valid or missing" ) ); + $opts->{keywords} = []; } elsif (grep { length($_) < 2 } @{$opts->{keywords}}) { fatal_error( _g( "keyword too short (keywords need to have at least two characters)" ) ); } diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index b8698cc..1a51ba3 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -24,6 +24,7 @@ sub do_search_contents { if ($params->{errors}{keywords}) { fatal_error( _g( "keyword not valid or missing" ) ); + $opts->{keywords} = []; } elsif (grep { length($_) < 2 } @{$opts->{keywords}}) { fatal_error( _g( "keyword too short (keywords need to have at least two characters)" ) ); } diff --git a/lib/Packages/DoShow.pm b/lib/Packages/DoShow.pm index 6f8a71c..d42c9a0 100644 --- a/lib/Packages/DoShow.pm +++ b/lib/Packages/DoShow.pm @@ -70,7 +70,7 @@ sub do_show { unless (@results || @non_results ) { fatal_error( _g( "No such package." )."
". - sprintf( _g( 'Search for the package' ), "$SEARCH_URL/$pkg" ) ); + sprintf( _g( 'Search for the package' ), make_search_url('','keywords='.uri_escape($pkg)) ) ); } else { my %all_suites; foreach (@results, @non_results) { diff --git a/lib/Packages/HTML.pm b/lib/Packages/HTML.pm index 6a6baf6..c7dfd0b 100644 --- a/lib/Packages/HTML.pm +++ b/lib/Packages/HTML.pm @@ -211,7 +211,7 @@ sub dep_item { my ( $suite, $name, $info, $desc ) = @_; my ($link, $post_link) = ('', ''); if ($suite) { - $link = "$suite})."\">"; + $link = "$suite,source=>undef})."\">"; $post_link = ''; } if ($info) { @@ -235,7 +235,7 @@ sub provides_string { my $short_desc = $also ? _g("also a virtual package provided by ") : _g("virtual package provided by "); if (@provided_by < 10) { - $short_desc .= join( ', ',map { "$suite})."\">$_" } @provided_by); + $short_desc .= join( ', ',map { "$suite,source=>undef})."\">$_" } @provided_by); } else { $short_desc .= sprintf( _g("%s packages"), scalar(@provided_by)); } @@ -530,7 +530,7 @@ sub trailer { "

". sprintf( _g( "To report a problem with the web site, e-mail %s. For other contact information, see the Debian contact page." ), $CONTACT_MAIL, $CONTACT_MAIL, $HOME). "

\n". - "

". _g( "Last Modified: " ). "LAST_MODIFIED_DATE". + "

". _g( "Last Modified: " ). gmtime(). "
\n". sprintf( _g( "Copyright © 1997-2005 SPI; See license terms." ), "$HOME/" )."
\n". _g( "Debian is a registered trademark of Software in the Public Interest, Inc." ).