From: Frank Lichtenheld Date: Sun, 5 Jul 2009 22:16:40 +0000 (+0200) Subject: Merge branch 'master' into archive-master X-Git-Url: https://git.deb.at/?a=commitdiff_plain;ds=sidebyside;h=6a99f4714326a371636fae11a2613160a32d8c8f;hp=-c;p=deb%2Fpackages.git Merge branch 'master' into archive-master Conflicts: static/index.tmpl templates/config.tmpl --- 6a99f4714326a371636fae11a2613160a32d8c8f diff --combined conf/apache.conf.sed.in index 7c78ef6,91833a6..49d88fa --- a/conf/apache.conf.sed.in +++ b/conf/apache.conf.sed.in @@@ -8,7 -8,10 +8,7 @@@ # Nice caching.. ExpiresActive On - ExpiresDefault "access plus 1 day" - ExpiresByType image/gif "modification plus 1 year" - ExpiresByType image/jpeg "modification plus 1 year" - ExpiresByType image/png "modification plus 1 year" + ExpiresDefault "access plus 1 year" # language stuff # you need to keep this in sync with lib/Packages/I18N/Locale.pm @@@ -69,18 -72,18 +69,18 @@@ ErrorLog /var/log/apache2/%SITE%-error.log CustomLog /var/log/apache2/%SITE%-access.log combined - Alias /cgi-bin/ %TOPDIR%/cgi-bin/ + ScriptAlias /cgi-bin/ %TOPDIR%/cgi-bin/ PerlModule ModPerl::Registry PerlTaintCheck On - PerlRequire %TOPDIR%/bin/mod_perl-startup +# PerlRequire %TOPDIR%/bin/mod_perl-startup PerlSwitches -T - SetHandler perl-script - PerlInitHandler Apache2::Reload - PerlHandler ModPerl::Registry +# SetHandler perl-script +# PerlInitHandler Apache2::Reload +# PerlHandler ModPerl::Registry Options +ExecCGI - PerlSendHeader On +# PerlSendHeader On allow from all @@@ -108,22 -111,23 +108,23 @@@ RewriteRule ^/robots.txt$ - [L] # RewriteRule ^/$ http://www.debian.org/distrib/packages - RewriteRule ^/$ /index.html [L] + RewriteRule ^/$ /index [L] RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N] RewriteRule ^/changelog:(.+)$ /changelogs/${changelog-url:$1} [R,L,NE] RewriteRule ^/src:([^/]+)$ /search?searchon=sourcenames&keywords=$1 [R,L,NE] RewriteRule ^/file:(.+)$ /search?searchon=contents&keywords=$1 [R,L,NE] - RewriteCond %{QUERY_STRING} ^$ [OR] - RewriteCond %{REQUEST_URI} !^/search$ - RewriteCond %{REQUEST_URI} !^/cgi-bin/search_(contents|packages)\.pl$ - RewriteRule ^/([^/]+)$ /search?keywords=$1 [R,L,NE] - + RewriteCond %{QUERY_STRING} ="" RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -f [OR] RewriteCond %TOPDIR%/www%{REQUEST_FILENAME}.en.html -f [OR] RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -l RewriteRule . - [L] + RewriteCond %{QUERY_STRING} ^$ [OR] + RewriteCond %{REQUEST_URI} !^/search$ + RewriteCond %{REQUEST_URI} !^/cgi-bin/search_(contents|packages)\.pl$ + RewriteRule ^/([^/]+)$ /search?keywords=$1 [R,L,NE] + RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [L,PT] # In case we need to disable the site again diff --combined lib/Packages/Dispatcher.pm index a46b2d5,08c6f96..6da9b12 --- a/lib/Packages/Dispatcher.pm +++ b/lib/Packages/Dispatcher.pm @@@ -94,7 -94,7 +94,7 @@@ sub do_dispatch &Packages::DB::init(); my $last_modified = $Packages::DB::db_read_time; my $now = time; - my $expires = $last_modified + (12*3600); + my $expires = $last_modified + (365*24*3600); $expires = $now + 3600 if $expires < $now; # allow some fudge, since the db mod time is not the end of # the cron job @@@ -177,7 -177,11 +177,11 @@@ } elsif (@components == 0) { fatal_error( "We're supposed to display the homepage here, instead of getting dispatch.pl" ); } elsif (@components == 1) { - $what_to_do = 'search'; + if ($components[0] eq 'index') { + $what_to_do = 'homepage'; + } else { + $what_to_do = 'search'; + } } else { for ($components[-1]) { diff --combined lib/Packages/DoIndex.pm index 9eaf34e,6af0c3a..40f79fd --- a/lib/Packages/DoIndex.pm +++ b/lib/Packages/DoIndex.pm @@@ -12,7 -12,12 +12,12 @@@ use Packages::Config qw( $TOPDIR ) use Packages::CGI; our @ISA = qw( Exporter ); - our @EXPORT = qw( do_index do_allpackages ); + our @EXPORT = qw( do_homepage do_index do_allpackages ); + + sub do_homepage { + $_[1]->{suite} = []; + return send_file( 'index', @_ ); + } sub do_index { return send_file( 'index', @_ ); @@@ -46,7 -51,7 +51,7 @@@ sub send_file my $wwwdir = "$TOPDIR/www"; my $path = ""; $path .= "source/" if $opts->{source}; - $path .= "$opts->{suite}[0]/"; + $path .= "$opts->{suite}[0]/" if @{$opts->{suite}}; $path .= "$opts->{archive}[0]/" if @{$opts->{archive}} == 1; $path .= "$opts->{subsection}[0]/" if @{$opts->{subsection}}; $path .= "$opts->{priority}[0]/" if @{$opts->{priority}}; @@@ -63,7 -68,7 +68,7 @@@ $headers{'-content-length'} = $size; $headers{'-vary'} = 'negotiate,accept-language'; $headers{'-last-modified'} = strftime("%a, %d %b %Y %T %z", localtime($mtime)); - $headers{'-expires'} = strftime("%a, %d %b %Y %T %z", localtime($mtime+(12*3600))); + $headers{'-expires'} = strftime("%a, %d %b %Y %T %z", localtime($mtime+(365*24*3600))); print header( %headers ); binmode INDEX; diff --combined templates/html/homepage.tmpl index 0000000,aa17ea6..bebb31f mode 000000,100644..100644 --- a/templates/html/homepage.tmpl +++ b/templates/html/homepage.tmpl @@@ -1,0 -1,118 +1,119 @@@ + [%- PROCESS 'html/head.tmpl' + title_tag = g('%s Packages Search', organisation) + page_title = g('%s Packages Search', organisation) + keywords = g('Packages') + -%] + [%- - all_suites = [ 'etch', 'etch-m68k', 'etch-volatile', 'etch-backports', - 'lenny', 'lenny-volatile', 'lenny-backports', 'squeeze', 'sid' ] - version_numbers = { sarge => '3.1', - etch => '4.0', - lenny => '5.0' } - current_release = 'lenny' ++ all_suites = [ 'bo', 'hamm', 'slink', 'potato', 'woody', 'sarge' ] ++ version_numbers = { sarge => '3.1', ++ woody => '3.0', ++ potato => '2.2', ++ slink => '2.1', ++ hamm => '2.0', ++ bo => '1.3.1'} ++ current_release = 'sarge' + all_sections = [ 'main', 'contrib', 'non-free' ] - all_architectures = [ 'alpha', 'arm', 'armel', 'amd64', 'avr32', 'hppa', 'i386', - 'ia64', 'kfreebsd-amd64', 'kfreebsd-i386', 'mips', - 'mipsel', 'm68k', 'powerpc', 's390', 'sparc' ] ++ all_architectures = [ 'alpha', 'arm', 'hppa', 'i386', 'ia64', ++ 'mips', 'mipsel', 'powerpc', 's390', 'sparc' ] + -%] + +

[% g('This site provides you with information about all the packages available in the %s Package archive.', project_homepage, organisation) %]

+ +

[% g('Please contact %s if you encounter any problems!', admin.mail, admin.name) %]

+ +

[% g('Browse through the lists of packages:') %]

+ + + +

[% g('There is also a list of packages recently added to %s.', all_suites.-1, all_suites.-1) %]

+ +

[% g('Old releases can be found at %s.', old_releases, old_releases) %]

+ +

[% g('Search') %]

+ +

[% g('Search package directories') %]

+ +
+ + + +
+ [% g('Search on:') %] + +    + + + + +
+ [% g('Only show exact matches:') %] + +
+ Distribution: + + [% g('Section:') %] + +
+

[% g('There are shortcuts for some searches available:') %]

+ +
+ +

[% g('Search the contents of packages') %]

+ +

[% g('This search engine allows you to search the contents of %s distributions for any files (or just parts of file names) that are part of packages. You can also get a full list of files in a given package.', organisation) %]
+

+ + + +   + + +   +
+ [% g('Display:') %] +
+ + +
+ + +
+ + +
+ + + + + +
+ + [% PROCESS 'html/foot.tmpl' page_name=packages_homepage copyright.years = '1997 - 2009' %]