]> git.deb.at Git - deb/packages.git/commitdiff
Merge branch 'master' into archive-master
authorFrank Lichtenheld <frank@lichtenheld.de>
Sun, 5 Jul 2009 22:16:40 +0000 (00:16 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Sun, 5 Jul 2009 22:16:40 +0000 (00:16 +0200)
Conflicts:
static/index.tmpl
templates/config.tmpl

1  2 
conf/apache.conf.sed.in
lib/Packages/Dispatcher.pm
lib/Packages/DoIndex.pm
templates/html/homepage.tmpl

diff --combined conf/apache.conf.sed.in
index 7c78ef65150c468302410bfefa1cd96162bc1390,91833a623313e3d87bc44f671ee13ffec8ac828c..49d88faef1c74f91e1108aab90defebee52b77ff
@@@ -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
     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>
  
     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
index a46b2d54e4ad637c0fbc43f1d4f34bceb256402b,08c6f96a1c7cee40a1985e2a88eeb3006908f27f..6da9b12d8a24ab0b28f9824e591e65ef5fc4e05f
@@@ -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
        } 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 9eaf34e08135914a52013421881c49fb92d00e12,6af0c3ab34bee37de557845e6a1f9f2a389dc8f9..40f79fd67ac28784ff33da2349a752b35678e3d5
@@@ -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;
index 0000000000000000000000000000000000000000,aa17ea64f8fe26cdcb7f3f526d2ed6f3187a7dcc..bebb31f760470911f4141f33e9e53702550b5c5a
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,118 +1,119 @@@
 -    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'
+ [%- PROCESS 'html/head.tmpl' 
+       title_tag = g('%s Packages Search', organisation)
+       page_title = g('%s Packages Search', organisation)
+       keywords = g('Packages')
+ -%]
+ [%-
 -    all_architectures = [ 'alpha', 'arm', 'armel', 'amd64', 'avr32', 'hppa', 'i386',
 -                        'ia64', 'kfreebsd-amd64', 'kfreebsd-i386', 'mips',
 -                        'mipsel', 'm68k', 'powerpc', 's390', 'sparc' ]
++    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', '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>&nbsp;&nbsp;
+ <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"> &nbsp;
+ <input type="submit" value="[% g('Search') %]">
+ &nbsp;<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' %]