The following commit has been merged in the archive-master branch:
commit 6a99f4714326a371636fae11a2613160a32d8c8f
Merge: 1e0b8833ffc8fa00e781ee09072599f18599a004
02bdaff0b3a148bf4ebe3687125fb981d194e8ba
Author: Frank Lichtenheld <[email protected]>
Date: Mon Jul 6 00:16:40 2009 +0200
Merge branch 'master' into archive-master
Conflicts:
static/index.tmpl
templates/config.tmpl
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
<Location /cgi-bin/>
- 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
</Location>
@@@ -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' ]
+ -%]
+
+ <p>[% g('This site provides you with information about all the packages
available in the <a href="%s">%s</a> Package archive.', project_homepage,
organisation) %]</p>
+
+ <p><em>[% g('Please contact <a href="mailto:%s">%s</a> if you encounter any
problems!', admin.mail, admin.name) %]</em></p>
+
+ <h2>[% g('Browse through the lists of packages:') %]</h2>
+
+ <ul style="font-size:large">
+ [% FOREACH s IN all_suites %]
+ <li><a href="[% s %]/">[% s %]</a>
+ [% IF version_numbers.$s %]([% version_numbers.$s %])[% END %]</li>
+ [% END %]
+ </ul>
+
+ <p>[% g('There is also a list of <a href="%s/main/newpkg">packages recently
added to %s</a>.', all_suites.-1, all_suites.-1) %]</p>
+
+ <p>[% g('Old releases can be found at <a href="%s">%s</a>.', old_releases,
old_releases) %]</p>
+
+ <h2>[% g('Search') %]</h2>
+
+ <h3>[% g('Search package directories') %]</h3>
+
+ <form method="GET" action="/search">
+ <label for="kw">[% g('Keyword:') %]</label>
+ <input type="text" size="30" name="keywords" id="kw">
+ <input type="submit" value="[% g('Search') %]"> <input type="reset" value="[%
g('Reset') %]">
+ <br>
+ [% g('Search on:') %]
+ <input type="radio" name="searchon" value="names" id="onlynames"
checked="checked">
+ <label for="onlynames">[% g('Package names only') %]</label>
+ <input type="radio" name="searchon" value="all" id="descs">
+ <label for="descs">[% g('Descriptions') %]</label>
+ <input type="radio" name="searchon" value="sourcenames" id="src">
+ <label for="src">[% g('Source package names') %]</label>
+ <br>
+ [% g('Only show exact matches:') %]
+ <input type="checkbox" name="exact" value="1">
+ <br>
+ Distribution:
+ <select name="suite">
+ [% FOREACH s IN all_suites %]
+ <option value="[% s %]" [% 'selected="selected"' IF s == current_release
%]>[% s %]</option>
+ [% END %]
+ <option value="all">[% g('any') %]</option>
+ </select>
+ [% g('Section:') %]
+ <select name="section">
+ [% FOREACH s IN all_sections %]
+ <option value="[% s %]">[% s %]</option>
+ [% END %]
+ <option value="all" selected="selected">[% g('any') %]</option>
+ </select>
+ </form>
+ <p>[% g('There are shortcuts for some searches available:') %]</p>
+ <ul>
+ <li>[% g('<code>%s<var>name</var></code> for the search on package
names.', packages_homepage_abs) %]</li>
+
+ <li>[% g('<code>%ssrc:<var>name</var></code> for the search on source
package names.', packages_homepage_abs) %]</li>
+ </ul>
+ <hr>
+
+ <h3><a name="search_contents">[% g('Search the contents of packages')
%]</a></h3>
+
+ <p>[% 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) %]<br>
+ <form method="GET" action="/search">
+ <input type="hidden" name="searchon" value="contents">
+
+ <label for="keyword">[% g('Keyword:') %]</label>
+ <input type="text" size="30" name="keywords" id="keyword">
+
+ <input type="submit" value="[% g('Search') %]">
+ <input type="reset" value="[% g('Reset') %]">
+ <br>
+ [% g('Display:') %]
+ <br>
+ <input type="radio" name="mode" value="exactfilename" id="exactfilename"
checked="checked">
+ <label for="exactfilename">[% g('packages that contain files named like
this') %]</label>
+ <br>
+ <input type="radio" name="mode" value="" id="suffixpathname">
+ <label for="suffixpathname">[% g('packages that contain files whose names
end with the keyword') %]</label>
+ <br>
+ <input type="radio" name="mode" value="filename" id="filename">
+ <label for="filename">[% g('packages that contain files whose names contain
the keyword') %]</label>
+ <br>
+ <label for="distro">[% g('Distribution:') %]</label>
+
+ <select name="suite" id="distro">
+ [% FOREACH s IN all_suites %]
+ <option value="[% s %]" [% 'selected="selected"' IF s == current_release
%]>[% s %]</option>
+ [% END %]
+ </select>
+ <label for="architecture">[% g('Architecture:') %]</label>
+ <select name="arch" id="architecture">
+ [% FOREACH a IN all_architectures %]
+ <option value="[% a %]">[% a %]</option>
+ [% END %]
+ <option value="any" selected="selected">[% g('any') %]</option>
+ </select>
+ </form>
+
+ [% PROCESS 'html/foot.tmpl' page_name=packages_homepage copyright.years =
'1997 - 2009' %]
--
APT Archive Web-Frontend (Alioth repository)
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]