From: Frank Lichtenheld Date: Sun, 9 Sep 2007 15:11:25 +0000 (+0000) Subject: Merge commit 'origin/master' into debian-master X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=a123e85c68ef74c0ddcaf31321b41bbd4043a655;hp=6d049bd100a65f8aab957442243991f632381279;p=deb%2Fpackages.git Merge commit 'origin/master' into debian-master --- diff --git a/conf/apache.conf.sed.in b/conf/apache.conf.sed.in index c9c3022..c71ef22 100644 --- a/conf/apache.conf.sed.in +++ b/conf/apache.conf.sed.in @@ -74,6 +74,9 @@ # RSS stuff AddType application/rss+xml .rdf .xml + + RemoveType .gz + AddEncoding x-gzip .gz @@ -129,6 +132,13 @@ RewriteRule ^/src:([^/]+)$ /source/$1 [R,L,NE] RewriteRule ^/file:(.+)$ http://%SITE%/search?searchon=contents&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 [OR] + RewriteCond %TOPDIR%/www%{REQUEST_FILENAME} -d + RewriteRule . - [L] + RewriteRule ^/(.+)$ /cgi-bin/dispatcher.pl/$1 [L,PT] # In case we need to disable the site again diff --git a/config.sh.sed.in b/config.sh.sed.in index 1c8658e..0b298a0 100644 --- a/config.sh.sed.in +++ b/config.sh.sed.in @@ -31,13 +31,14 @@ volatile_ftpsite=http://volatile.debian.org/debian-volatile backports_ftpsite=http://backports.org/debian amd64_ftpsite=http://amd64.debian.net/debian gnuab_ftpsite=http://kfreebsd-gnu.debian.net/debian +ddtp_ftpsite=http://ddtp.debian.net/debian root="" # Architectures # polangs="de fi nl fr uk" -ddtplangs="de cs da eo es fi fr hu it ja nl pl pt_BR pt_PT ru sk sv_SE uk" +ddtplangs="ca cs da de eo es fi fr go hu it ja km_KH ko nl pl pt pt_BR ru sk sv uk zh zh_CN zh_TW" archives="us security amd64 gnuab backports volatile" sections="main contrib non-free" parts="$sections" diff --git a/cron.d/120synctrans b/cron.d/120synctrans index 12767ab..115b59f 100755 --- a/cron.d/120synctrans +++ b/cron.d/120synctrans @@ -5,9 +5,13 @@ test -d ${archivedir} || mkdir -p ${archivedir} cd ${archivedir} -if [ -z "${localdir}" ] +if [ -z "${localdir}" ] || [ -n "$ddtp_ftpsite" ] then - echo using remote mirror + if [ -z "$ddtp_ftpsite" ] + then + ddtp_ftpsite="$ftpsite" + fi + echo using remote mirror $ddtp_ftpsite for dist in sid do for part in main @@ -17,7 +21,7 @@ then do echo retrieve translated Descs $dist/$part/$lang (cd us/${dist}/${part}/i18n && - wget -q -N ${ftpsite}/dists/${dist}/${part}/i18n/Translations-$lang.gz) + wget -q -N ${ddtp_ftpsite}/dists/${dist}/${part}/i18n/Translation-$lang.gz) done done done diff --git a/cron.d/200process_archive b/cron.d/200process_archive index 6fa394e..b8f6a6d 100755 --- a/cron.d/200process_archive +++ b/cron.d/200process_archive @@ -9,7 +9,7 @@ date date ./bin/parse-sources date -./bin/parse-contents -date ./bin/parse-translations date +./bin/parse-contents +date diff --git a/lib/Packages/Dispatcher.pm b/lib/Packages/Dispatcher.pm index 440b159..037f7f3 100755 --- a/lib/Packages/Dispatcher.pm +++ b/lib/Packages/Dispatcher.pm @@ -314,7 +314,9 @@ Packages::CGI::init_url( $input, \%params, \%opts ); debug => ( DEBUG ? $opts{debug} : 0 ) }, ( $CACHEDIR ? { COMPILE_DIR => $CACHEDIR } : {} ) ); - unless (-e "$TEMPLATEDIR/$opts{format}/${what_to_do}.tmpl") { + #FIXME: ugly hack + unless (($what_to_do eq 'allpackages' and $opts{format} =~ /^(html|txt\.gz)/) + || -e "$TEMPLATEDIR/$opts{format}/${what_to_do}.tmpl") { fatal_error( "requested format not available for this document", "406 requested format not available"); } diff --git a/lib/Packages/DoIndex.pm b/lib/Packages/DoIndex.pm index 8f96fdf..45a5b49 100644 --- a/lib/Packages/DoIndex.pm +++ b/lib/Packages/DoIndex.pm @@ -46,7 +46,12 @@ sub send_file { $path .= "$opts->{priority}[0]/" if @{$opts->{priority}}; # we don't have translated index pages for subsections yet $opts->{lang} = 'en' if @{$opts->{subsection}} or $file eq 'allpackages'; - $path .= "$file.$opts->{lang}.$opts->{format}"; + + #FIXME: ugly hack + if ($opts->{lang} ne 'en' and !-f "$wwwdir/$path$file.$opts->{lang}.$opts->{format}") { + $opts->{lang} = 'en'; + } + $path .= "$file.$opts->{lang}.$opts->{format}"; unless (@Packages::CGI::fatal_errors) { my $buffer; @@ -55,6 +60,9 @@ sub send_file { $headers{'-charset'} = get_charset( $opts->{lang} ); $headers{'-type'} = get_mime( $opts->{format}, 'text/plain' ); $headers{'-content-encoding'} = $encoding{$opts->{format}} if exists $encoding{$opts->{format}}; + my ($size,$mtime) = (stat("$wwwdir/$path"))[7,9]; + $headers{'-content-length'} = $size; + $headers{'-last-modified'} = gmtime($mtime); print header( %headers ); binmode INDEX; diff --git a/templates/html/foot.tmpl b/templates/html/foot.tmpl index f54d494..17a5e2a 100644 --- a/templates/html/foot.tmpl +++ b/templates/html/foot.tmpl @@ -10,9 +10,9 @@ Total page evaluation took [% benchmark %]

This page is also available in the following languages:

How to set the default document language