]> git.deb.at Git - deb/packages.git/commitdiff
Merge branch 'master' of ssh://source/srv/source.djpig.de/git/packages into ubuntu...
authorFrank Lichtenheld <frank@lichtenheld.de>
Wed, 12 Sep 2007 20:51:18 +0000 (22:51 +0200)
committerFrank Lichtenheld <frank@lichtenheld.de>
Wed, 12 Sep 2007 20:51:18 +0000 (22:51 +0200)
Conflicts:

conf/apache.conf.sed.in
config.sh.sed.in
lib/Packages/Search.pm

50 files changed:
BACKEND
URLS
bin/build-maintainerdb
bin/create_index_pages
bin/daily [deleted file]
bin/daily.sed.in [new file with mode: 0755]
bin/extract_changelogs
bin/extract_files
bin/newpkg_info
bin/parse-contents
bin/parse-debtags-voc
bin/parse-packages
bin/parse-sources
bin/parse-translations
bin/setup-site
cgi-bin/index.html
conf/apache.conf.sed.in
config.sh.sed.in
cron.d/010git
cron.d/050checkinst
cron.d/100syncarchive
cron.d/100syncarchive_gnuab
cron.d/120synctrans
cron.d/200process_archive
cron.d/600prepare_newpkg
lib/Deb/Versions.pm
lib/Packages/Dispatcher.pm
lib/Packages/DoDownload.pm
lib/Packages/DoFilelist.pm
lib/Packages/DoIndex.pm
lib/Packages/DoNewPkg.pm
lib/Packages/DoSearch.pm
lib/Packages/DoSearchContents.pm
lib/Packages/DoShow.pm
lib/Packages/I18N/LanguageNames.pm
lib/Packages/I18N/Languages.pm
lib/Packages/Page.pm
lib/Packages/Search.pm
lib/Packages/Sections.pm
static/packages.css.sed.in
templates/config/archive_layout.tmpl
templates/config/mirrors.tmpl
templates/html/filelist.tmpl
templates/html/foot.tmpl
templates/html/head.tmpl
templates/html/index.tmpl
templates/html/newpkg.tmpl
templates/html/search.tmpl
templates/html/show.tmpl
templates/txt/index.tmpl

diff --git a/BACKEND b/BACKEND
index 11f14091cf21eae8474d9dbcb902228c395030e7..7c87b1c78f3855369b5275dfe70272b6cec1fa73 100644 (file)
--- a/BACKEND
+++ b/BACKEND
@@ -1,5 +1,3 @@
-$Id$
-
 Most package data is available via sleepycat databases. Those have been
 specifically crafted for efficient lookup, and reasonable times to generate
 them, so that both the daily cronjobs and the actual pagerequests take only a
diff --git a/URLS b/URLS
index 359730dd0bce686d1381fa03197ff59e1dd6475d..418e0330cede8a759359916ce641ccf42cbec8a4 100644 (file)
--- a/URLS
+++ b/URLS
@@ -1,5 +1,3 @@
-$Id$
-
 Proposal for URL layout
 
 $ROOT/search <- search handling
index 1978854bf9fa2b431551b71aa120a710c065265f..b64be0023413ef0decd1eb919dc20fa1459d6117 100755 (executable)
@@ -2,6 +2,7 @@
 
 #   build-maintainerdb - convert several Packages files to maintainer database
 #   Copyright (c) 1998,9,2001,3,4,6  Martin Schulze <joey@debian.org>
+#   Copyright (C) 2007 Joerg Jaspert <joerg@debian.org>
 #
 #   This program is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
@@ -15,9 +16,7 @@
 #
 #   You should have received a copy of the GNU General Public License
 #   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# $Id$
+#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 #   Todo:
 #    . Read maintainer changes from overrides file(s), need to rub
 
 use strict;
 use warnings;
+use DB_File;
+
+use lib '../lib';
+
+use Deb::Versions;
 
 # read the configuration
 if (!open (C, "../config.sh")) {
@@ -38,14 +42,61 @@ while (<C>) {
 close (C);
 
 my $maildomain = "packages.debian.org";
+my $ptsdomain = "packages.qa.debian.org";
 
-my $maintainerfile = "$topdir/archive/Maintainers";
+
+my $maintainerfile = "$topdir/../ftp.root/debian/indices/Maintainers";
 my $maintainerdb = "$topdir/conf/maintainer";
 my $overridefile = "$topdir/conf/maintainerdb.override";
 my @postcall = ( "/usr/sbin/postmap", $maintainerdb );
 my $opt_verbose = 0;
+my $dbdir = "$topdir/files/db";
 
 my %maint;
+my %binsrc;
+
+# Lets take pdo database input files for the source mapping
+sub read_bin_src_mapping
+{
+    tie my %src_packages, 'DB_File', "$dbdir/sources_small.db",
+    O_RDONLY, 0666, $DB_BTREE
+       or die "couldn't tie DB $dbdir/sources_small.db: $!";
+    tie my %src2bin, 'DB_File', "$dbdir/sources_packages.db",
+    O_RDONLY, 0666, $DB_BTREE
+       or die "couldn't open $dbdir/sources_packages.db: $!";
+
+    my %bin;
+    while (my ($source, $data) = each %src_packages) {
+       my @src = map { [ split(/\s+/) ] } split( /\0/, $data );
+       my $newest = (sort( { version_cmp($b->[-1],$a->[-1]) } @src))[0];
+       my ($section, $version) = @{$newest}[2,5];
+       
+       my $bin_data = $src2bin{$source};
+       unless ($bin_data) {
+           warn "no binary data found for $source\n";
+           # source packages without binaries have most
+           # likely been succeded
+           next;
+       }
+       
+       my @bin = map { [ split(/\s+/) ] } split( /\0/, $bin_data );
+       my %seen;
+       foreach (@bin) {
+           my ($pkg, $ver) = @{$_}[2,3];
+           next if $seen{"$pkg/$ver"}++; # weed out multiple arches/suites faster
+           if ($bin{$pkg}
+               && ($bin{$pkg}{source} ne $source)
+               && (version_cmp($bin{$pkg}{version},$ver) > 0)) {
+               next;
+           } else {
+               $bin{$pkg} = { version => $ver, source => $source,
+                              target => "$section" };
+               $binsrc{$pkg} = $source;
+           }
+       }
+       $binsrc{$source} = $source;
+    }
+}
 
 sub package_maintainer
 {
@@ -95,20 +146,23 @@ sub read_maintainer
                }
 
            printf "  %s: %s\n", $package, $maint{$package} if ($opt_verbose > 1);
-           my $pkgshort = "";
-           if ($package =~ /(.*[^\d\.]+)([\d\.]*\d)$/) {
-               $pkgshort = $1;
-               $maint{$pkgshort} = $maint{$package} if (! exists $maint{$pkgshort});
-               printf "  %s: %s\n", $pkgshort, $maint{$package} if ($opt_verbose > 1);
-           }
-           if ($maint{$package} =~ /([^\@]+)\@(master\.)?debian\.org/) {
-               my $addrsave = $maint{$package} if ($opt_verbose > 1);
-               $maint{$package} = package_maintainer ($package, $1, $maint{$package});
-               printf "  Changed to %s\n", $maint{$package} if ($opt_verbose > 1 && ($addrsave ne $maint{$package}));
-               if (length ($pkgshort) > 0) {
-                   $maint{$pkgshort} = package_maintainer ($pkgshort, $1, $maint{$pkgshort});
-               }
-           }
+
+# Short what? Whats this supposed to do, except creating new (and 99% broken) something -> email mappings?
+#          my $pkgshort = "";
+#          if ($package =~ /(.*[^\d\.]+)([\d\.]*\d)$/) {
+#              $pkgshort = $1;
+#              print "Short what? $pkgshort (long is $package)\n";
+#              $maint{$pkgshort} = $maint{$package} if (! exists $maint{$pkgshort});
+#              printf "  %s: %s\n", $pkgshort, $maint{$package} if ($opt_verbose > 1);
+#          }
+#          if ($maint{$package} =~ /([^\@]+)\@(master\.)?debian\.org/) {
+#              my $addrsave = $maint{$package} if ($opt_verbose > 1);
+#              $maint{$package} = package_maintainer ($package, $1, $maint{$package});
+#              printf "  Changed to %s\n", $maint{$package} if ($opt_verbose > 1 && ($addrsave ne $maint{$package}));
+#              if (length ($pkgshort) > 0) {
+#                  $maint{$pkgshort} = package_maintainer ($pkgshort, $1, $maint{$pkgshort});
+#              }
+#          }
        } else {
            printf "Skipping double $package\n" if ($opt_verbose);
            printf "LINE: $_" if ($opt_verbose > 2);
@@ -117,15 +171,27 @@ sub read_maintainer
     close (F);
 }
 
+
+
 sub write_maintainer
 {
     my $file = shift;
 
     printf "Writing to %s.new\n", $file if ($opt_verbose > 0);
     open (CONF, ">$file.new") || die "Can't open $file.new, $!";
+    my $forward;
     foreach my $package (sort(keys(%maint))) {
-       printf "%s -> %s\n", $package, $maint{$package} if ($opt_verbose > 1);
-       printf CONF "%s@%s\t%s\n", $package, $maildomain, $maint{$package};
+# It is possible that we do not know a source package -> in that case fall back to old behaviour
+# and only mail the maintainer. Can happen when pdo doesnt know the suite the source is in, like
+# it doesnt know oldstable-proposed-updates at date of writing this code.
+       $forward = "$maint{$package}";
+       if ($binsrc{$package}) {
+           $forward .= ", $binsrc{$package}_contact\@$ptsdomain";
+       }
+       printf "%s -> %s\n", $package, $forward if ($opt_verbose);
+       printf CONF "%s@%s\t%s\n", $package, $maildomain, $forward;
+#      printf "%s -> %s and pts: %s\n", $package, $maint{$package}, $binsrc{$package} if ($opt_verbose);
+#      printf CONF "%s@%s\t%s, %s_contact@%s\n", $package, $maildomain, $maint{$package}, $binsrc{$package}, $ptsdomain;
     }
     close (CONF);
     printf "Renaming to %s\n", $file if ($opt_verbose > 0);
@@ -162,6 +228,8 @@ while ($#ARGV > -1) {
     shift;
 }
 
+&read_bin_src_mapping();
+
 &read_maintainer ($overridefile);
 &read_maintainer ($maintainerfile);
 
index 2c62033ddce7a22d6a3155b906ad7b99ce214904..30962ea8653bef1dc4ab969ca8c77ad5b14bc5c9 100755 (executable)
@@ -44,8 +44,6 @@ tie my %src2bin, 'DB_File', "$DBDIR/sources_packages.db",
 
 my $sections = retrieve "$DBDIR/sections.info";
 my $subsections = retrieve "$DBDIR/subsections.info";
-# work around problems with non-US security updates
-$subsections->{oldstable}{us}{'non-US'}++;
 my $priorities = retrieve "$DBDIR/priorities.info";
 
 #use Data::Dumper;
diff --git a/bin/daily b/bin/daily
deleted file mode 100755 (executable)
index 0a67587..0000000
--- a/bin/daily
+++ /dev/null
@@ -1,53 +0,0 @@
-#! /bin/bash
-
-#   Copyright (c) 2004  Martin Schulze <joey@debian.org>
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 2 of the License, or
-#   (at your option) any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License
-#   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-# Should run after the mirror pulse.  The mirror tends to finish by
-# the ctime of rsync.log.* in ~archvsync.
-
-source config.sh
-files=$topdir/files
-logs=$files/logs
-log=$logs/cron.log
-
-test -d $files || mkdir -p $files
-test -d $logs || mkdir -p $logs
-
-if [ -s $log ]
-then
-    savelog -c 14 $log > /dev/null
-fi
-
-date > $log
-
-if lockfile -600 -r5 "${files}/cron.lock" >> $log 2>&1
-then
-    run-parts --verbose $topdir/cron.d >> $log 2>&1
-    rm -f "${files}/cron.lock"
-else
-    echo "couldn't aquire cron lock file in due time" >> $log
-fi
-date >> $log
-
-if lockfile -600 -r5 "${files}/changelogs.lock" >> $log 2>&1
-then
-    $topdir/bin/extract_changelogs >> $log 2>&1
-    rm -f "${files}/changelogs.lock"
-else
-    echo "couldn't aquire changelogs lock file in due time" >> $log
-fi
-date >> $log
diff --git a/bin/daily.sed.in b/bin/daily.sed.in
new file mode 100755 (executable)
index 0000000..28c8333
--- /dev/null
@@ -0,0 +1,55 @@
+#! /bin/bash
+
+#   Copyright (c) 2004  Martin Schulze <joey@debian.org>
+#
+#   This program is free software; you can redistribute it and/or modify
+#   it under the terms of the GNU General Public License as published by
+#   the Free Software Foundation; either version 2 of the License, or
+#   (at your option) any later version.
+#
+#   This program is distributed in the hope that it will be useful,
+#   but WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#   GNU General Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License
+#   along with this program; if not, write to the Free Software
+#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Should run after the mirror pulse.  The mirror tends to finish by
+# the ctime of rsync.log.* in ~archvsync.
+
+source %TOPDIR%/config.sh
+files=$topdir/files
+logs=$files/logs
+log=$logs/cron.log
+
+test -d $files || mkdir -p $files
+test -d $logs || mkdir -p $logs
+
+if [ -s $log ]
+then
+    savelog -c 14 $log > /dev/null
+fi
+
+exec >"$log" 2>&1
+
+date
+
+if lockfile -300 -r2 "${files}/cron.lock"
+then
+    run-parts --verbose $topdir/cron.d
+    rm -f "${files}/cron.lock"
+else
+    echo "couldn't aquire cron lock file in due time"
+fi
+date
+
+if lockfile -300 -r2 "${files}/changelogs.lock"
+then
+    $topdir/bin/extract_changelogs
+    rm -f "${files}/changelogs.lock"
+else
+    echo "couldn't aquire changelogs lock file in due time"
+fi
+date
index 08be087d36fadde7f5a6cbbf05e7c702a4374e07..7d6f3e4769bafb894f7469b1b5c26443db6b2c80 100755 (executable)
@@ -26,21 +26,29 @@ fi
 (
 date
 
+successful=1
 for part in $parts; do
     time "${bindir}/extract_files" -v -d "${localdir}/pool/$part/" \
        -t "${htmldir}/changelogs/pool/$part/" \
        -c "$configdir" -w "$tmpdir" \
        --dumpfile "${filesdir}/changelogs.$part.dump" \
-       --cachefile "${filesdir}/changelogs.cache"
+       --cachefile "${filesdir}/changelogs.cache" --debug
+    if [ $? -ne 0 ]; then
+        echo program exited with non-zero exitcode: $? >&2
+       successful=0
+    fi
 done
 
-find "${htmldir}/changelogs/" -name log -cmin +7200 \
- | while read logfile; do
-       dir=$(dirname "$logfile")
+if [ "$successful" -eq 1 ]; then
+    find "${htmldir}/changelogs/" -name log -cmin +14440 \
+     | while read logfile; do
+       dir=$(dirname "$logfile")
        echo deleting $dir
        rm -r "$dir"
        rmdir --ignore-fail-on-non-empty $(dirname "$dir")
-done
-
+    done
+else
+    echo clean-up skipped because at least one of the extraction runs failed >&2
+fi
 date
 ) > $log 2>&1
index 2d4dbdcd4ab64e1f90d0d0a052aa46f826760419..3bfc5599e4bcce91d11a45c1b5facb2a2468b81f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 #
 # Script to extract files from Debian packages
-# Copyright 2004 Frank Lichtenheld
+# Copyright 2004-2007 Frank Lichtenheld <frank@lichtenheld.de>
 #
 # based on a shell script which was
 # Copyright 2003 Noel Köthe
@@ -19,7 +19,7 @@
 #
 #    You should have received a copy of the GNU General Public License
 #    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
@@ -72,7 +72,15 @@ my %opthash = (
               'help' => \$help,
               );
 
-my (%src_packages, %bin_packages, %cache, %stats);
+my (%src_packages, %bin_packages, %cache);
+
+my %stats = (
+    src_pkgs => 0,
+    src_cache => 0,
+    already_extracted => 0,
+    bin_pkgs => 0,
+    bin_cache => 0,
+    );
 
 Getopt::Long::config('no_getopt_compat', 'no_auto_abbrev');
 
@@ -126,26 +134,20 @@ sub add_log {
 # PACKAGE HANDLING (UNPACKING/CLEANUP)
 
 sub unpack_srcpkg {
-    my ( $dscname, $log ) = @_;
+    my ( $pkgname, $dscname, $log ) = @_;
 
     chdir( $TEMPDIR ) or do_error( "couldn't change working directory to $TEMPDIR" );
 
-    add_log( $log, "dpkg-source -sn -x $dscname"  );
-
-    my $out = qx/dpkg-source -sn -x "$dscname" 2>&1/;
-    my ($dir) = ($out =~ /(\S+)$/mo);
+    add_log( $log, "dpkg-source -sn -x $dscname $pkgname+source"  );
 
-    add_log( $log, "dpkg-source output: ", $out );
-
-#Bug#246802
-#    system("dpkg-source", "-x", $dscname ) == 0
-#      or do {
-#          do_warning( "couldn't unpack $dscname" );
-#          add_log( $log, "couldn't unpack $dscname" );
-#          return;
-#      };
+    system("dpkg-source", "-sn", "-x", $dscname, "$pkgname+source" ) == 0
+       or do {
+           do_warning( "couldn't unpack $dscname: $!" );
+           add_log( $log, "couldn't unpack $dscname: $!" );
+           return;
+       };
 
-    return $dir;
+    return "$pkgname+source";
 }
 
 sub unpack_binpkg {
@@ -401,7 +403,7 @@ sub extract_files {
        return;
     }
 
-    if (my $source_dir = unpack_srcpkg( $pkg_data->{dsc}, \$log )) {
+    if (my $source_dir = unpack_srcpkg( $pkg_data->{src_name}, $pkg_data->{dsc}, \$log )) {
 
        $source_dir = "$TEMPDIR/$source_dir";
 
@@ -529,7 +531,7 @@ sub read_dsc {
        dsc => $dscname,
     };
 
-    unless( $pkg_data->{src_name} && $pkg_data->{src_version}
+    unless( $pkg_data->{src_name} && defined($pkg_data->{src_version})
        && $pkg_data->{dsc} ) {
        use Data::Dumper;
        do_error( "something fishy happened.\n", Dumper( $pkg_data ) );
index e2f36aef9790dcd4d7ec14136a9abb6d8fec73ac..37b7290753d4567c9da0938f7813b58995c6708c 100755 (executable)
@@ -62,11 +62,15 @@ for (my $age = 0; $age < 7; $age++) {
        $changes{$_} = -1;
     }
 
-    my %archives = map { $_ => 1 } qw( us security non-US );
+    my %archives = map { $_ => 1 } qw( us security );
     foreach (sort keys %changes) {
-       my $entry = read_entry_simple( \%packages, $_, \%archives, $suite)
-           or die "Fatal Error: Can't find entry for package $_\n";
-       shift @$entry; # remove virtual pkg info
+       my $entry = [];
+       if ($changes{$_} == 1) {
+           $entry = read_entry_simple( \%packages, $_, \%archives, $suite);
+           die "Fatal Error: Can't find entry for package $_\n"
+               unless @$entry;
+           shift @$entry; # remove virtual pkg info
+       }
        print CHANGES join(" ", $_, $age, @$entry)."\n";
        print "Wrote entry: ".join(" ", $_, $age, @$entry)."\n";
     }
index 767aad433ff57b01e5bf0c41e5b86994f4aea252..36c90b1479fd54e937d80c21601e94dcd1f87532 100755 (executable)
@@ -2,8 +2,6 @@
 # Convert Contents.gz files into Sleepycat db files for efficient usage of
 # data
 #
-# $Id$
-#
 # Copyright (C) 2006  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +15,7 @@
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use lib './lib';
index 4caf0b0444089302c5567f93b6c6d6cf22fde7ec..85649a6dddde38a494aafbd5431bc7e77cacfcf0 100755 (executable)
@@ -1,8 +1,6 @@
 #!/usr/bin/perl -w
 # Convert Debtags vocabulary.gz files into Sleepycat db files
 #
-# $Id: parse-packages 227 2006-11-12 20:24:48Z djpig $
-#
 # Copyright (C) 2006  Frank Lichtenheld <djpig@debian.org>
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +14,7 @@
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
index b0883a279da39798715b9b9a0a67eb73527ecd45..6e27c3a2bae3802ccac3ba26b31df412980d194d 100755 (executable)
@@ -2,9 +2,9 @@
 # Convert Packages.gz files into Sleepycat db files for efficient usage of
 # data
 #
-# $Id$
-#
 # Copyright (C) 2006  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+# Copyright (C) 2006-2007 Frank Lichtenheld <frank@lichtenheld.de>
+#
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +17,7 @@
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
@@ -149,8 +149,6 @@ for my $suite (@SUITES) {
                my $subsection = $data{section} || '-';
                if ($data{section} && ($data{section} =~ m=/=o)) {
                    ($section, $subsection) = split m=/=o, $data{section}, 2;
-                   ($subsection, $section) = split m=/=o, $data{section}, 2
-                       if $section eq 'non-US';
                }
                $data{'section'} = $section;
                $data{'subsection'} = $subsection;
@@ -269,6 +267,7 @@ print "Index $#descriptions descriptions\n";
 for (my $i=1; $i<= $#descriptions; $i++) {
        # strip away additional data
        my ($only_desc, $pkg, $tags) = split /\000/o, $descriptions[$i], 3;
+       my $orig_desc = $only_desc;
 # WARNING: This needs to correspond with what happens in
 # Packages/Search.pm:do_xapian_search
        $only_desc =~ s#[^\w/+]+# #og;
@@ -316,7 +315,7 @@ for (my $i=1; $i<= $#descriptions; $i++) {
        };
        die $@ if $@;
 
-       $descriptions_db{$i} = $only_desc;
+       $descriptions_db{$i} = $orig_desc;
 }
 untie %descriptions_db;
 $xapian_db->flush;
index 8ec35dbb94d4cdeb7071564eb3dc7a25f7693f1d..da49d6ad4ede971f0955a6d6435c202c65eddeee 100755 (executable)
@@ -2,8 +2,6 @@
 # Convert Sources.gz files into Sleepycat db files for efficient usage of
 # data
 #
-# $Id$
-#
 # Copyright (C) 2006  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +15,7 @@
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use lib './lib';
@@ -77,8 +75,6 @@ for my $archive (@ARCHIVES) {
                my $subsection = $data{section} || '-';
                if ($data{section} && ($data{section} =~ m=/=o)) {
                    ($section, $subsection) = split m=/=o, $data{section}, 2;
-                   ($subsection, $section) = split m=/=o, $data{section}, 2
-                       if $section eq 'non-US';
                }
                $data{'section'} = $section;
                $data{'subsection'} = $subsection;
index fa9855db14ca200bf38466ceeb6fde23188e706e..095820421b1871347712295016b770f1b561434a 100755 (executable)
@@ -2,9 +2,8 @@
 # Convert Translation.gz files into Sleepycat db files for efficient usage of
 # data
 #
-# $Id$
-#
 # Copyright (C) 2006  Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
+# Copyright (C) 2007  Frank Lichtenheld <frank@lichtenheld.de>
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 2 of the License, or
@@ -17,7 +16,7 @@
 
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
 use warnings;
index c277ecba7850c1f1fafedba6dd8d8b3f34a17c9e..a0a7839460c2f14bbb7e029274c72730c00757b3 100755 (executable)
@@ -16,6 +16,7 @@ do
        wdir=$(dirname "$file")
        newfile="$wdir/"$(basename "$file" .sed.in)
        echo -e "processing\n\t$file\n->\t$newfile"
-       sed -e "s#%SITE%#$site#g;s#%TOPDIR%#$topdir#g" "$file" > "$newfile"
+       cp -p "$file" "$newfile"
+       sed -i -e "s#%SITE%#$site#g;s#%TOPDIR%#$topdir#g" "$newfile"
        diff -u "$file" "$newfile"
 done
index 16e0dddb879c0259187e5e65b85146f6061d8caa..e4084a3bc920a10b50e8c3f4b3b49f19ec1e7019 100644 (file)
@@ -30,7 +30,6 @@ Section:
   <option value="main">main</option>
   <option value="contrib">contrib</option>
   <option value="non-free">non-free</option>
-  <option value="non-us">non-US</option>
   <option value="all" selected="selected">any</option>
 </select>
 
index 6384605b1666e4f3102a20c4ee5aa4b28f3bdb14..bbb24d943fef27941504174d673a0248bba05ee7 100644 (file)
@@ -74,6 +74,9 @@
 
   # RSS stuff
   AddType application/rss+xml .rdf .xml
+
+  RemoveType .gz
+  AddEncoding x-gzip .gz
 </Directory>
 
 <VirtualHost *>
@@ -88,6 +91,7 @@
 #   PerlModule ModPerl::Registry
 #   PerlTaintCheck On
 #   PerlRequire %TOPDIR%/bin/mod_perl-startup
+#   PerlSwitches -T
    <Location /cgi-bin/>
 #      SetHandler perl-script
       # mod-perl etch
    RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N]
    RewriteRule ^/changelog:(.+)$  http://%SITE%/changelogs/${changelog-url:$1} [R,L,NE]
    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]
 
index 155e8b8ea140b6cee4f19d13c03d0506491f2e46..1be02c86ae55de54a5b0f92ebb303ea5e6827bda 100644 (file)
@@ -20,26 +20,26 @@ cachedir=${topdir}/cache
 # unset this if %SITE% moves somewhere where the packages files
 # cannot be obtained locally
 #
-localdir=/org/ftp.debian.org/debian
+#localdir=/org/ftp.debian.org/debian
 
 # path to private ftp directory
 #ftproot=/org/ftp.root
 
 ftpsite=http://archive.ubuntu.com/ubuntu
 security_ftpsite=$ftpsite
+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"
 sections="main multiverse restricted universe"
 parts="${sections}"
 suites="warty hoary hoary-backports breezy breezy-backports dapper dapper-backports edgy edgy-backports feisty"
 priorities="required important standard optional extra"
-dists="${suites}"
 architectures="i386 amd64 powerpc"
 arch_warty="i386 amd64 powerpc"
 arch_warty_updates="${arch_warty}"
index 7a18d6db8e91b60b15cee90727ef090921dd1f68..fd91aab19bb1e68e6718c4363495f486d27ebab1 100755 (executable)
@@ -15,7 +15,7 @@
 #
 #   You should have received a copy of the GNU General Public License
 #   along with this program; if not, write to the Free Software
-#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 . `dirname $0`/../config.sh
 
index 7f054cb8ca152da1876b655588102213d72e6b0f..fff00880bc47b74581e1f4ecd1a5b87f69ffee00 100755 (executable)
@@ -11,8 +11,9 @@ required="$required libtext-iconv-perl libhtml-template-perl"
 required="$required libclass-accessor-perl"
 required="$required liburi-perl libxml-rss-perl"
 required="$required libtemplate-perl libi18n-acceptlanguage-perl"
+required="$required liblingua-stem-perl"
 
-locales="de_DE.UTF-8 en_US.UTF-8 nl_NL fr_FR.UTF-8"
+locales="de_DE.UTF-8 en_US.UTF-8 nl_NL fr_FR.UTF-8 uk_UA.UTF-8"
 
 packages=`tempfile`
 locs=`tempfile`
index 928fefc07b5bc653bdabcfa4ada5207439df0b28..5cb5af4e2769af6a5ef098560b5a0886b72f8fc6 100755 (executable)
@@ -51,9 +51,8 @@ else
     do
         echo "retrieve Releases(.gpg) $dist"
        test -d us/${dist} || mkdir -p us/${dist}
-       (cd us/${dist} &&
-           rsync -t ${localdir}/dists/${dist}/Release &&
-           rsync -t ${localdir}/dists/${dist}/Release.gpg )
+       rsync -t ${localdir}/dists/${dist}/Release us/${dist}/Release
+       rsync -t ${localdir}/dists/${dist}/Release.gpg us/${dist}/Release.gpg
 
        foo=\$arch_${dist//-/_}
        for arch in `eval echo $foo`
@@ -86,7 +85,7 @@ fi
 
 # security archive
 #
-for dist in oldstable stable testing
+for dist in sarge etch lenny
 do
     echo "retrieve Release(.gpg) $dist"
     test -d security/${dist} || mkdir -p security/${dist}
index 1295c633f930a4d91ea41caee35dddff91974d58..b42d165cbd6f19000d5c34602d47c8aa0f00ecea 100755 (executable)
@@ -9,7 +9,7 @@ cd ${archivedir}
 #
 architectures="armel kfreebsd-i386 kfreebsd-amd64"
 
-for dist in unstable experimental
+for dist in sid experimental
   do
   echo "retrieve Release(.gpg) $dist"
   test -d gnuab/${dist} || mkdir -p gnuab/${dist}
index add4c3513a50937145669a38718c17eb927064d2..115b59fa86c8ad8e9e63011e8e7e047a798adeb4 100755 (executable)
@@ -5,10 +5,14 @@
 test -d ${archivedir} || mkdir -p ${archivedir}
 cd ${archivedir}
 
-if [ -z "${localdir}" ]
+if [ -z "${localdir}" ] || [ -n "$ddtp_ftpsite" ]
 then
-    echo using remote mirror
-    for dist in unstable
+    if [ -z "$ddtp_ftpsite" ]
+    then
+       ddtp_ftpsite="$ftpsite"
+    fi
+    echo using remote mirror $ddtp_ftpsite
+    for dist in sid
     do
        for part in main
        do
@@ -17,13 +21,13 @@ 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
 else
     echo using local mirror
-    for dist in unstable
+    for dist in sid
     do
        for part in main
        do
index 6fa394e61f861c5dcd27d89de0ce87910bb058c8..b8f6a6d2bb611e3068d8cceb7630a45f486f2dfc 100755 (executable)
@@ -9,7 +9,7 @@ date
 date
 ./bin/parse-sources
 date
-./bin/parse-contents
-date
 ./bin/parse-translations
 date
+./bin/parse-contents
+date
index 083d72ec0b281c2905a93da1e2163fe9f3692fc0..bddf65bb57d1b206f9df07ca53e6074ac6ae6c62 100755 (executable)
@@ -5,11 +5,11 @@
 packagesdir=${filesdir}/packages
 test -d ${packagesdir} || mkdir -p ${packagesdir}
 
-LANG=C cat ${filesdir}/db/package_names_unstable.txt \
-    | sort | uniq > ${packagesdir}/package_names_unstable.$(date -I)
+LANG=C cat ${filesdir}/db/package_names_sid.txt \
+    | sort | uniq > ${packagesdir}/package_names_sid.$(date -I)
 LANG=C cat ${filesdir}/db/source_names_unstable.txt \
-    | sort | uniq > ${packagesdir}/source_names_unstable.$(date -I)
+    | sort | uniq > ${packagesdir}/source_names_sid.$(date -I)
 
 cd $topdir
 
-./bin/newpkg_info unstable
+./bin/newpkg_info sid
index 366af76bccca359450606767630c77936c52f4ba..d8d8282a3fcd39d3324dc5536632ac203d310668 100644 (file)
@@ -1,6 +1,5 @@
 #
 # Deb::Versions
-# $Id$
 #
 # Copyright 2003, 2004 Frank Lichtenheld <frank@lichtenheld.de>
 #
@@ -16,7 +15,7 @@
 #
 #    You should have received a copy of the GNU General Public License
 #    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
 =head1 NAME
@@ -142,9 +141,9 @@ sub _lcmp {
     for ( my $i = 0; $i <= length( $v1 ); $i++ ) {
        my ( $n1, $n2 ) = ( ord( substr( $v1, $i, 1 ) ), 
                            ord( substr( $v2, $i, 1 ) ) );
-       $n1 += 256 if $n1 < 65; # letters sort earlier than non-letters
+       $n1 += 256 if $n1 && $n1 < 65; # letters sort earlier than non-letters
        $n1 = -1 if $n1 == 126; # '~' sorts earlier than everything else
-       $n2 += 256 if $n2 < 65;
+       $n2 += 256 if $n2 && $n2 < 65;
        $n2 = -1 if $n2 == 126;
        if ( my $r = ($n1 <=> $n2) ) {
            return $r;
@@ -154,9 +153,9 @@ sub _lcmp {
 }
 
 our @SUITES_SORT = qw( woody oldstable sarge stable stable-proposed-updates
-                      etch etch-m68k testing testing-proposed-updates sid unstable
-                      experimental warty hoary hoary-backports breezy
-                      breezy-backports dapper );
+                      etch etch-m68k testing testing-proposed-updates lenny
+                      sid unstable experimental
+                      warty hoary breezy breezy dapper edgy feisty gutsy );
 our @ARCHIVE_SORT = qw( non-US security updates volatile backports );
 our @PRIORITY_SORT = qw( required important standard optional extra );
 my $i = 1000;
index 3dcab38719d42f772282f87e748a57658ad93777..a360ddf3a467a51881e697f2027034308284c6d9 100755 (executable)
@@ -15,7 +15,7 @@
 #
 #    You should have received a copy of the GNU General Public License
 #    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 package Packages::Dispatcher;
 
@@ -25,6 +25,7 @@ use warnings;
 use CGI;
 use POSIX;
 use File::Basename;
+use URI;
 use URI::Escape;
 use HTML::Entities;
 use Template;
@@ -65,6 +66,13 @@ sub do_dispatch {
     delete $ENV{'LC_ALL'};
     delete $ENV{'LC_MESSAGES'};
 
+    my %SUITES_ALIAS = ( oldstable => 'sarge',
+                        stable => 'etch',
+                        testing => 'lenny',
+                        unstable => 'sid',
+                        '3.1' => 'sarge',
+                        '4.0' => 'etch' );
+
     # Read in all the variables set by the form
     my $input;
     if ($ARGV[0] && ($ARGV[0] eq 'php')) {
@@ -168,10 +176,6 @@ sub do_dispatch {
            }
 
            my %SUITES = map { $_ => 1 } @SUITES;
-           my %SUITES_ALIAS = ( sarge => 'oldstable',
-                                etch => 'stable',
-                                lenny => 'testing',
-                                sid => 'unstable', );
            my %SECTIONS = map { $_ => 1 } @SECTIONS;
            my %ARCHIVES = map { $_ => 1 } @ARCHIVES;
            my %ARCHITECTURES = map { $_ => 1 } (@ARCHITECTURES, 'all', 'any');
@@ -202,8 +206,6 @@ sub do_dispatch {
                    set_param_once( $input, \%params_set, 'archive', $_);
                } elsif (!$need_pkg && $sections_descs{$_}) {
                    set_param_once( $input, \%params_set, 'subsection', $_);
-               } elsif (!$need_pkg && ($_ eq 'non-us')) { # non-US hack
-                   set_param_once( $input, \%params_set, 'subsection', 'non-US');
                } elsif (!$need_pkg && ($_ eq 'source')) {
                    set_param_once( $input, \%params_set, 'source', 1);
                } elsif ($ARCHITECTURES{$_}) {
@@ -223,8 +225,9 @@ sub do_dispatch {
        } # else if (@components == 1)
 
        if (@components) {
-           $input->param( 'keywords', $components[0] );
-           $input->param( 'package', $components[0] );
+           my $c = uri_unescape($components[0]);
+           $input->param( 'keywords', $c );
+           $input->param( 'package', $c );
        }
     }
 
@@ -240,7 +243,8 @@ sub do_dispatch {
                       suite => { default => 'default', match => '^([\w-]+)$',
                                  array => ',', var => \@suites,
                                  replace => { all => \@SUITES,
-                                              default => \@SUITES } },
+                                              default => \@SUITES,
+                                              %SUITES_ALIAS } },
                       archive => { default => ($what_to_do eq 'search') ?
                                        'all' : 'default',
                                        match => '^([\w-]+)$',
@@ -266,7 +270,7 @@ sub do_dispatch {
                                 array => ',', var => \@archs, replace =>
                                 { any => \@ARCHITECTURES } },
                       format => { default => 'html', match => '^([\w.]+)$',  },
-                  mode => { default => undef, match => '^(\w+)$',  },
+                  mode => { default => '', match => '^(\w+)$',  },
                   sort_by => { default => 'file', match => '^(\w+)$', },
                   );
     my %opts;
@@ -311,7 +315,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");
     }
@@ -327,6 +333,11 @@ Packages::CGI::init_url( $input, \%params, \%opts );
 
     $page_content{make_search_url} = sub { return &Packages::CGI::make_search_url(@_) };
     $page_content{make_url} = sub { return &Packages::CGI::make_url(@_) };
+    $page_content{extract_host} = sub { my $uri = URI->new($_[0]);
+                                        my $host = $uri->host;
+                                        $host .= ':'.$uri->port if $uri->port != $uri->default_port;
+                                        return $host;
+                                      };
     # needed to work around the limitations of the the FILTER syntax
     $page_content{html_encode} = sub { return HTML::Entities::encode_entities(@_,'<>&"') };
     $page_content{uri_escape} = sub { return URI::Escape::uri_escape(@_) };
index 7c59272085c3db58e923c24562ae5be720c3b128..bc7dbab0e6d57a78783f81ede244f65e76cc6876 100644 (file)
@@ -85,9 +85,11 @@ sub do_download {
            $page_content->{archive} = $archive;
            $page_content->{suite} = $suite;
            $page_content->{pkg} = $pkg;
-           $page_content->{pkgsize} = sprintf( '%.1f', floor(($data{size}/102.4)+0.5)/10 );
-           $page_content->{pkgsize_unit} = _g( 'kByte' );
-           if ($page_content->{pkgsize} > 1024) {
+           my $pkgsize = floor(($data{size}/102.4)+0.5)/10;
+           if ($pkgsize < 1024) {
+               $page_content->{pkgsize} = sprintf( '%.1f', $pkgsize );
+               $page_content->{pkgsize_unit} = _g( 'kByte' );
+           } else {
                $page_content->{pkgsize} = sprintf( '%.1f', floor(($data{size}/(102.4*102.4))+0.5)/100 );
                $page_content->{pkgsize_unit} = _g( 'MByte' );
            }
index c8061905add7ef5f6a806b5d815ec3d3b4387a89..f76efb91e2bfc429cab119a7ea211ef26b784be4 100644 (file)
@@ -51,7 +51,7 @@ sub do_filelist {
                fatal_error( _g( "No such package in this suite on this architecture." ) );
            } else {
                my @files = unpack "L/(CC/a)", $contents{$pkg};
-               my $file;
+               my $file = '';
 
                $page_content->{files} = [];
                for (my $i=0; $i<scalar @files;) {
index 8f96fdf8b20ef6f79a4353480bfca06c3ebc3f9d..45a5b494bf8a7ba16da24b9a0a1b0093590190c9 100644 (file)
@@ -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;
index c9e0ca23f009f79615048c7d1a4519230667e2e7..60e6876c6274c53a044c933e9b48128e0d842bc9 100644 (file)
@@ -30,7 +30,7 @@ sub do_newpkg {
 
     my $sort_func = sub { $_[0][0] cmp $_[1][0] };
     $sort_func = sub { $_[0][1] <=> $_[1][1] or $_[0][0] cmp $_[1][0] }
-    if $opts->{mode} eq 'byage';
+       if $opts->{mode} eq 'byage';
 
     my $suite = $opts->{suite}[0];
     my $one_archive = @{$opts->{archive}} == 1 ?
@@ -46,6 +46,7 @@ sub do_newpkg {
        chomp;
        my @data = split /\s/, $_, 10;
 
+       next unless $data[2]; #removed packages
        next unless $data[3] eq $suite;
        next if $one_archive and $data[2] ne $one_archive;
        next if $one_section and $data[5] ne $one_section;
index 5f91d2463adb3fd2addbae713e43dc3c9ed3466c..c1b6dfdd01cd8c51420a530e68ff895eb9bab91b 100644 (file)
@@ -123,7 +123,7 @@ sub do_search {
                    $version) = @$_;
 
                my $real_archive = '';
-               if ($archive =~ /^(security|non-US)$/) {
+               if ($archive eq 'security') {
                    $real_archive = $archive;
                    $archive = 'us';
                }
index 29b79770d44ef4407430f7a3e2aa5f3c3ef09a78..7054bb90c1ff7904c9ae6483d0894b090fb38f38 100644 (file)
@@ -14,7 +14,7 @@ our @EXPORT = qw( do_search_contents );
 use Deb::Versions;
 use Packages::I18N::Locale;
 use Packages::Search qw( :all );
-use Packages::CGI;
+use Packages::CGI qw( :DEFAULT error );
 use Packages::DB;
 use Packages::Config qw( $DBDIR @SUITES @ARCHIVES @ARCHITECTURES $ROOT );
 
@@ -34,7 +34,7 @@ sub do_search_contents {
     #FIXME: that's extremely hacky atm
     if ($params->{values}{suite}{no_replace}[0] eq 'default') {
        $params->{values}{suite}{no_replace} =
-           $params->{values}{suite}{final} = $opts->{suite} = [ 'stable' ];
+           $params->{values}{suite}{final} = $opts->{suite} = [ 'etch' ];
     }
 
     if (@{$opts->{suite}} > 1) {
@@ -82,6 +82,7 @@ sub do_search_contents {
                if @keywords;
 
            my $kw = reverse $first_kw;
+           $kw =~ s{/+$}{};
 
            # exact filename searching follows trivially:
            $kw = "$kw/" if $mode eq 'exactfilename';
index 1d21462878d4dbcf0e2a21f8e9d16c48000bcab8..30158c54b42d35ce6f5dcc91e8b008aac502efb3 100644 (file)
@@ -120,9 +120,13 @@ sub do_show {
                        my $std = timediff($st1, $st0);
                        debug( "Data search and merging took ".timestr($std) ) if DEBUG;
 
+                       my @similar = find_similar( $pkg, "$DBDIR/xapian/",
+                                                   \%did2pkg );
+                       $contents{similar} = \@similar;
+
                        my $did = $page->get_newest( 'description' );
                        my $desc_md5 = $page->get_newest( 'description-md5' );
-                       my @complete_tags = split(/, /, $page->get_newest( 'tag' ));
+                       my @complete_tags = split(/, /, $page->get_newest( 'tag' )||'' );
                        my @tags;
                        foreach (@complete_tags) {
                            my ($facet, $tag) = split( /::/, $_, 2);
@@ -302,8 +306,7 @@ sub do_show {
                    foreach( @$source_files ) {
                        my ($src_file_md5, $src_file_size, $src_file_name)
                            = split /\s+/, $_;
-                       (my $server = lc $archive) =~ s/-//go; # non-US hack
-                       $server = $FTP_SITES{$server}
+                       my $server = $FTP_SITES{lc $archive}
                            || $FTP_SITES{us};
                        my $path = "/$source_dir/$src_file_name";
 
@@ -357,9 +360,7 @@ sub moreinfo {
            foreach( @$files ) {
                my ($src_file_md5, $src_file_size, $src_file_name) = split /\s/o, $_;
                my ($server, $path);
-               # non-US hack
-               ($server = lc $page->get_newest('archive')) =~ s/-//go;
-               $server = $env->{$server}||$env->{us};
+               $server = $env->{lc $page->get_newest('archive')}||$env->{us};
                $path = "/$src_dir/$src_file_name";
                push @downloads, { name => $src_file_name, server => $server, path => $path };
            }
@@ -372,7 +373,6 @@ sub moreinfo {
            (my $src_basename = $source_version) =~ s,^\d+:,,; # strip epoche
            $src_basename = "${source}_$src_basename";
            $src_dir =~ s,pool/updates,pool,o;
-           $src_dir =~ s,pool/non-US,pool,o;
 
            $contents->{files}{changelog}{path} = "$src_dir/$src_basename/changelog";
            $contents->{files}{copyright}{path} = "$src_dir/$src_basename/".( $is_source ? 'copyright' : "$name.copyright" );
index d414e474a9aa0be338fa906aa30445e5eb9f2b26..8798f493af370241c224452e323fc239a31cbf02 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-#
 # Taken from the webwml CVS tree (english/templates/language_names.wml)
 
 package Packages::I18N::LanguageNames;
index 9f30453c921e5cc870a16c6f94ae36cc8836140e..f13ac2f2ba71f2cb8b8547d6be036aba491e7770 100644 (file)
@@ -1,5 +1,3 @@
-# $Id$
-#
 # Taken from the webwml CVS tree (english/templates/languages.wml)
 
 package Packages::I18N::Languages;
index 96ee15665f444efe565620b50256c990401373c7..946a5a4f801d91e30f82c39c77fb53a6dfdb8a49 100644 (file)
@@ -95,7 +95,7 @@ sub is_virtual {
 }
 
 our @TAKE_NEWEST = qw( description description-md5 essential priority section subsection tag
-                      archive source source-version url );
+                      archive source source-version url homepage );
 our @STORE_ALL = qw( version source source-version installed-size size
                     filename md5sum sha1 sha256 task
                     origin bugs suite archive section );
index ad43390d38c1c7e33ca69551cd21cffea5b53433..3a204988504e95d144f23a1f5a31100883494b33 100644 (file)
@@ -1,8 +1,8 @@
 #
 # Packages::Search
 #
-# Copyright (C) 2004-2006 Frank Lichtenheld <frank@lichtenheld.de>
-# 
+# Copyright (C) 2004-2007 Frank Lichtenheld <frank@lichtenheld.de>
+#
 # The code is based on the old search_packages.pl script that
 # was:
 #
@@ -23,7 +23,7 @@
 #
 #    You should have received a copy of the GNU General Public License
 #    along with this program; if not, write to the Free Software
-#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
 =head1 NAME
@@ -58,6 +58,7 @@ our @ISA = qw( Exporter );
 our @EXPORT_OK = qw( read_entry read_entry_all read_entry_simple
                     read_src_entry read_src_entry_all find_binaries
                     do_names_search do_fulltext_search do_xapian_search
+                    find_similar
                     );
 our %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );
 
@@ -81,7 +82,7 @@ sub read_entry_all {
        }
     }
 
-    foreach (split /\000/o, $result) {
+    foreach (split(/\000/o, $result||'')) {
        my @data = split ( /\s/o, $_, 8 );
        debug( "Considering entry ".join( ':', @data), 2) if DEBUG;
        if ($opts->{h_suites}{$data[1]}
@@ -199,7 +200,7 @@ sub do_names_search {
 }
 
 sub do_xapian_search {
-    my ($keywords, $db, $did2pkg, $packages, $read_entry, $opts,
+    my ($keywords, $dbpath, $did2pkg, $packages, $read_entry, $opts,
        $results, $non_results) = @_;
 
 # NOTE: this needs to correspond with parse-packages!
@@ -211,7 +212,7 @@ sub do_xapian_search {
     my $stemmer = Lingua::Stem->new();
     my $stemmed_keywords = $stemmer->stem( @tmp );
 
-    my $db = Search::Xapian::Database->new( $db );
+    my $db = Search::Xapian::Database->new( $dbpath );
     my $enq = $db->enquire( OP_OR, @$keywords, @$stemmed_keywords );
     debug( "Xapian Query was: ".$enq->get_query()->get_description(), 1) if DEBUG;
     my @matches = $enq->matches(0, 999);
@@ -241,6 +242,50 @@ sub do_xapian_search {
     }
 }
 
+sub find_similar {
+    my ($pkg, $dbpath, $did2pkg) = @_;
+
+    my $db = Search::Xapian::Database->new( $dbpath );
+    my $enq = $db->enquire( "P$pkg" );
+    debug( "Xapian Query was: ".$enq->get_query()->get_description(), 1) if DEBUG;
+    my $first_match = ($enq->matches(0,1))[0]->get_document();
+
+    my @terms;
+    my $term_it = $first_match->termlist_begin();
+    my $term_end = $first_match->termlist_end();
+
+    for (; $term_it ne $term_end; $term_it++) {
+       debug( "TERM: ".$term_it->get_termname(), 3);
+       push @terms, $term_it->get_termname();
+    }
+
+    my $rel_enq = $db->enquire( OP_OR, @terms );
+    debug( "Xapian Query was: ".$rel_enq->get_query()->get_description(), 1) if DEBUG;
+    my @rel_pkg = $rel_enq->matches(2,20);
+
+#    use Data::Dumper;
+#    debug(Dumper(\@rel_pkg),1);
+
+    my (@order, %tmp_results);
+    foreach my $match ( @rel_pkg ) {
+       my $id = $match->get_docid();
+       my $result = $did2pkg->{$id};
+
+       foreach (split /\000/o, $result) {
+           my @data = split /\s/, $_, 3;
+           debug ("Considering $data[0], arch = $data[2], relevance=".$match->get_percent(), 3) if DEBUG;
+           next if $data[0] eq $pkg;
+           unless ($tmp_results{$data[0]}++) {
+               push @order, $data[0];
+           }
+       }
+    }
+    undef $db;
+
+    debug ("ORDER: @order", 2) if DEBUG;
+    return @order[0..10];
+}
+
 sub find_binaries {
     my ($pkg, $archive, $suite, $src2bin) = @_;
 
index 32eb2b050eb29ec6410a151d50af8c2be4441b39..2e4fd11781270a34cbfc3e474e370c4210ede4c0 100644 (file)
@@ -51,8 +51,6 @@ our %sections_descs = (
                                             N_("Daemons and clients to connect your Debian GNU/Linux system to the world.") ],
                      news              => [ N_("Newsgroups"),
                                             N_("Software to access Usenet, to set up news servers, etc.") ],
-                     'non-US'  => [ N_("Software restricted in the U.S."),
-                                    N_("These packages probably may not be used in or distributed from the U.S. due to software patents. You should check the regulations in your country before using this software.") ],
                      oldlibs   => [ N_("Old Libraries"),
                                     N_("Old versions of libraries, kept for backward compatibility with old applications.") ],
                      otherosfs => [ N_("Other OS\'s and file systems"),
index 1b2defed9c0383d40ad7c5e04c84e80c0230979c..9e09dd8192208d8f42abc3c0425e02e63662a5ee 100644 (file)
@@ -1,3 +1,11 @@
+@media handheld, print, projection, screen, tv {
+       .nonvisual { display: none; }
+}
+
+@media braille, embossed, speech, tty {
+       .visual { display: none; }
+}
+
 #hpacketsearch {
        display: block;
        padding-top: 1px;
@@ -76,18 +84,22 @@ h1 {
        list-style-type: none;
 }
 
+#pdeps table ul {
+       margin: 0;
+}
+
 #pdeps ul.uldep, #pdeps ul.uladep {
        list-style-type: disc;
        list-style-image: url(http://%SITE%/Pics/dep.gif);
 }
 
 #pdeps ul.ulrec, #pdeps ul.ulidep {
-       list-style-type: disc;
+       list-style-type: square;
        list-style-image: url(http://%SITE%/Pics/rec.gif);
 }
 
 #pdeps ul.ulsug {
-       list-style-type: disc;
+       list-style-type: circle;
        list-style-image: url(http://%SITE%/Pics/sug.gif);
 }
 
@@ -173,7 +185,7 @@ table#pdeplegend, #pdownload table {
        font-family: monospace;
 }
 #pdownload p {
-       display: inline;
+       margin-left: 1em;
 }
 
 #pdownloadnotes {
index 1eacb1600baa34d49bb5a2ea5bae290d4623d9f8..6e501c7ababaf3983d2b0c7f1cb8f3d506a1b00c 100644 (file)
@@ -2,4 +2,11 @@
    main_section = 'main'
    main_archive = 'us'
    standard_priority = 'optional'
+
+   suite_aliases = {
+               sarge => 'oldstable', 
+               etch => 'stable',
+               lenny => 'testing',
+               sid => 'unstable',
+                  }
 %]
index 4dbb61a99f4ac00badf81ddd02013a80345e5ed8..d80342d2649ec8bc1cacf8169071a7b96a1281f1 100644 (file)
@@ -18,12 +18,9 @@ mirrors = {
 #only amd64,i386                       "ftp.debian.org/debian",
                        "ftp.egr.msu.edu/debian",
                        "mirrors.kernel.org/debian",
-                       "debian.crosslink.net/debian",
 #not amd64                     "ftp-mirror.internap.com/pub/debian",
 #only amd64,i386                       "ftp.cerias.purdue.edu/pub/os/debian",
-                       "ftp.lug.udel.edu/debian",
                        "debian.lcs.mit.edu/debian",
-                       "debian.teleglobe.net",
                        "debian.oregonstate.edu/debian",
                ],
                europa => [
@@ -172,53 +169,6 @@ mirrors = {
                        "ftp.citkit.ru/pub/HURD/debian",
                ],
        },
-
-       nonus => {
-               mirror_list => 'http://www.debian.org/mirror/list-non-US',
-               north_america => [
-#                      "ftp.ca.debian.org/debian-non-US",
-                       "debian.yorku.ca/debian/non-US",
-                       "mirror.direct.ca/linux/debian-non-US",
-               ],
-               europa => [
-                       "non-us.debian.org/debian-non-US",
-                       "ftp.de.debian.org/debian-non-US",
-                       "ftp.at.debian.org/debian-non-US",
-                       "ftp.bg.debian.org/debian-non-US",
-                       "ftp.cz.debian.org/debian-non-US",
-                       "ftp.fi.debian.org/debian-non-US",
-                       "ftp.fr.debian.org/debian-non-US",
-                       "ftp.hr.debian.org/debian-non-US",
-                       "ftp.hu.debian.org/debian-non-US",
-                       "ftp.ie.debian.org/debian-non-US",
-                       "ftp.is.debian.org/debian-non-US",
-                       "ftp.it.debian.org/debian-non-US",
-                       "ftp.nl.debian.org/debian-non-US",
-                       "ftp.no.debian.org/debian-non-US",
-                       "ftp.pl.debian.org/debian/non-US",
-                       "ftp.si.debian.org/debian-non-US",
-                       "ftp.es.debian.org/debian-non-US",
-                       "ftp.se.debian.org/debian-non-US",
-                       "ftp.tr.debian.org/debian-non-US",
-                       "ftp.uk.debian.org/debian/non-US",
-               ],
-               australia => [
-                       "ftp.au.debian.org/debian-non-US",
-                       "ftp.wa.au.debian.org/debian-non-US",
-                       "ftp.nz.debian.org/debian-non-US",
-               ],
-               asia => [
-                       "ftp.jp.debian.org/debian-non-US",
-#                      "ftp.kr.debian.org/debian-non-US",
-                       "linux.csie.nctu.edu.tw/debian-non-US",
-                       "debian.linux.org.tw/debian-non-US",
-                       "linux.cdpa.nsysu.edu.tw/debian-non-US",
-               ],
-               south_america => [
-                       "ftp.br.debian.org/debian-non-US",
-                       "ftp.cl.debian.org/debian-non-US",
-               ],
-       },
 }
 
 ports_url = 'http://www.debian.org/ports/'
index be74cc35debc93ffb4c98f97d692612f87e4502c..dbf9feaf06262a4e7cd53b7d0056df47ce3a14b2 100644 (file)
@@ -15,3 +15,5 @@
 [% file %]
 [% '</pre></div>' IF loop.last -%]
 [% END %]
+
+[%- PROCESS 'html/foot.tmpl' -%]
index 493069863a1fafb13aad41ac1c3757ddbcece919..64eb5505c3e8ca1649c6b2fd2aea6411bde19b31 100644 (file)
@@ -11,9 +11,9 @@ Total page evaluation took [% benchmark %]<br>
 <!--UdmComment-->
 <p>This page is also available in the following languages:</p>
 <p class="navpara">
-[% FOREACH langs %]
-<a href="[% "$page_name?lang=$lang" %]" title="[% tooltip %]" hreflang="[% lang %]" lang="[% lang %]" rel="alternate">[% selfname %]
-[%- IF transliteration %] ([% transliteration %])[% END %]</a>
+[% FOREACH l IN langs %]
+<a href="[% "$page_name?lang=$l.lang" %]" title="[% l.tooltip %]" hreflang="[% l.lang %]" lang="[% l.lang %]" rel="alternate">[% l.selfname %]
+[%- IF l.transliteration %] ([% l.transliteration %])[% END %]</a>
 [% END %]
 </p>
 <p>How to set <a href="[% cn_help_url %]">the default document language</a></p>
index 00894ce9e95110e197376119cff4edb55c5ef452..1dbd8a83497ffd9d7b51b32e24492e2383a4491a 100644 (file)
@@ -53,7 +53,7 @@
 package names</option>
 <option value="all" [% selected IF search_field_values.searchon == 'all' %]>descriptions</option>
 <option value="sourcenames" [% selected IF search_field_values.searchon == 'sourcenames' %]>source package names</option>
-<option value="contents" [% selected IF search_field_values.searchon == 'contents' %]>package contents</option
+<option value="contents" [% selected IF search_field_values.searchon == 'contents' %]>package contents</option>
 </select>
 <input type="text" size="30" name="keywords" value="[% search_field_values.keywords | html %]" id="kw">
 <span style="font-size: 60%"><a href="[% searchformurl %]">all options</a></span>
index 11cab5ceee6e2ed3dee2a745109df6f2b3b7ec7a..043274a94de27e4075d49eddf4e2c9a0bc606efd 100644 (file)
@@ -31,7 +31,9 @@
   [% END %]
   [% IF providers.size %]
     <dt><a href="[% name %]" id="[% name %]">[% name %]</a></dt>
-       <dd>virtual package provided by [% FOREACH provider IN providers %]<a href="../[% provider | uri %]">[% provider %]</a>[% END %]</dd>
+       <dd>virtual package provided by
+       [% FOREACH provider IN providers %]<a href="../[% provider | uri %]">[% provider %]</a>
+       [%- ', ' UNLESS loop.last %][% END %]</dd>
     [% IF versions.length %]
       <dt><a href="[% name %]">[% name %]</a> ([% versions %])[% PROCESS markers %]</dt>
          <dd>[% desc | html %]</dd>
index 016dcb5b2623d64168f1ac33fb96cd1061716dd0..0f36b4cf807aa7b568f58113791801056ef4cc2e 100644 (file)
@@ -6,7 +6,12 @@
 -%]
 <h1>New Packages in "[% suite %]"</h1>
 
-<p>The following packages were added to suite <em>[% suite %]</em>[% " (section $section)" IF section %] in the [% organisation %] archive during the last 7 days.</p>
+<p>The following packages were added to suite <em>[% suite %]</em>[% " (section $section)" IF section %] in the [% organisation %] archive during the last 7 days. You can also display this list
+[%- IF opts.mode == 'byage' %]
+ <a href="[% make_url('newpkg','','mode','') %]">sorted by name</a>
+[%- ELSE %]
+ <a href="[% make_url('newpkg','mode=byage') %]">sorted by age</a>
+[%- END %].</p>
 <p>This information is also available as an <a href="newpkg?format=rss">RSS feed</a>
 <a href="newpkg?format=rss"><img src="http://planet.debian.org/rss10.png" alt="[RSS 1.0 Feed]"></a></p>
 
index 9eafd1ee313428e0bf9a35575e982c3a0096b7f2..faf582c596c1da612c2aaac922e9094b72299274 100644 (file)
@@ -65,7 +65,7 @@ Found <strong>[% results %]</strong> matching packages.</p>
 [% END %]
 
 [% IF too_many_hits %]
-[% IF opts.search != "names" %]
+[% IF opts.searchon != "names" %]
 <p id="psearchtoomanyhits">Note that this only shows the best matches, sorted by relevance.
 If the first few packages don't match what you searched for, try using more keywords or alternative
 keywords.</p>
@@ -85,8 +85,10 @@ Please consider using a longer keyword or more keywords.</p>
 [% FOREACH packages %]
   <h3>Package [% pkg %]</h3>
   <ul>
-  [% FOREACH s IN suites %]
-    <li class="[% s.suite %]"><a class="resultlink" href="[% make_url(pkg,'','suite',s.suite,'arch','','section','') %]">[% s.suite %]</a>[% ' (' _ s.subsection _ ')' IF s.subsection %]: [% s.desc %]  [%- IF s.section != main_section %] [<strong class="pmarker">[% s.section %]</strong>][% END %]
+  [% FOREACH s IN suites;
+       suite = s.suite %]
+    <li class="[% suite %]"><a class="resultlink" href="[% make_url(pkg,'','suite',suite,'arch','','section','') %]">[% suite %]
+       [%- ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite %]</a>[% ' (' _ s.subsection _ ')' IF s.subsection %]: [% s.desc %]  [%- IF s.section != main_section %] [<strong class="pmarker">[% s.section %]</strong>][% END %]
     [% FOREACH s.versions %]
       <br>[% version %] [%- IF archive != main_archive %] [<strong class="pmarker">[% archive %]</strong>][% END %]: [% architectures.join(' ') %]
     [% END %]
index c4b1e904f1bd7df684e1fffbf8a2f2a8f00a4fa7..1d9f655eb3835620a78696cfe53ef6e473395520 100644 (file)
@@ -1,6 +1,17 @@
 [% PROCESS 'config/archive_layout.tmpl' %]
 [% PROCESS 'config/mirrors.tmpl' %]
-[%- nav_arr = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/','','source',''), name=>suite }, ];
+[%- known_vcs = [ [ 'cvs', 'CVS', 'cvs' ],
+               [ 'svn', 'Subversion', 'subversion' ],
+               [ 'bzr', 'bzr', 'bzr' ],
+               [ 'darcs', 'Darcs', 'darcs' ],
+               [ 'arch', 'arch', 'tla' ],
+               [ 'git', 'Git', 'git-core' ],
+               [ 'hg', 'Hg', 'mercurial' ], ];
+   vcs_link = page.get_newest("vcs-browser");
+-%]
+[%- suite_name = suite;
+    SET suite_name = suite_name _ ' (' _ suite_aliases.$suite _ ')' IF suite_aliases.$suite;
+    nav_arr = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/','','source',''), name=>suite_name }, ];
     nav_arr.push( { title => 'Source packages', url=>make_url('/'), name=>'Source' } ) IF is_source;
     nav_arr.push( { prefix=>'Section:', title=>'All packages in this section', url=>make_url("$subsection/"), name=>subsection } );
     nav_arr.push( { prefix=>'Package:', name=>pkg } ); -%]
@@ -45,7 +56,6 @@
 <h1>Package: [% pkg %] ([% versions.short %])
 [% END %]
 [%- PROCESS marker text=archive IF archive && archive != main_archive %]
-[%- PROCESS marker text=subsection IF subsection == 'non-US' and archive != 'non-US' %]
 [%- PROCESS marker text=section IF section && section != main_section %]
 [%- PROCESS marker text='essential' IF page.get_newest('essential') == 'yes' %]</h1>
 
 <li><a href="[% pts_url _ pkg | uri %]">Developer Information (PTS)</a></li>
 [%- END %]
 
-[% IF files %]
+[% IF files && (!archive or archive == main_archive or archive == 'security') %]
 <li><a href="[% changelogs_url _ files.changelog.path %]">Debian Changelog</a></li>
 <li><a href="[% changelogs_url _ files.copyright.path %]">Copyright File</a></li>
 [% END %]
-</ul>
 
-[% vcs_link = page.get_newest("vcs-browser") %]
-[% #FIXME: should this only be used for the PTS?
-   known_vcs = [ [ 'cvs', 'CVS', 'cvs' ],
-               [ 'svn', 'Subversion', 'subversion' ],
-               [ 'bzr', 'bzr', 'bzr' ],
-               [ 'darcs', 'Darcs', 'darcs' ],
-               [ 'arch', 'arch', 'tla' ],
-               [ 'git', 'Git', 'git-core' ],
-               [ 'hg', 'Hg', 'mercurial' ], ];
-   FOREACH vcs IN known_vcs;
+[% IF vcs_link %]
+<li><a href="[% vcs_link %]" class="pvcslink">Debian Source Repository</a>
+[%- FOREACH vcs IN known_vcs;
        vcs_id = vcs.0; vcs_name = vcs.1; vcs_pkg = vcs.2;
        vcs_info = page.get_newest("vcs-$vcs_id");
        SET vcs_info = page.get_newest("x-vcs-$vcs_id") UNLESS vcs_info;
-       IF vcs_info; %]
-<p>Debian Package Repository (<acronym title="Version Control System">VCS</acronym>:
-<a href="[% make_url(vcs_pkg,'','source','') %]">[% vcs_name %]</a>):<br> <a href="[% vcs_info %]" class="pvcslink">[% vcs_info %]</a></p>
-[% IF vcs_link %]
-<p>Debian Package Repository (Browsable):<br> <a href="[% vcs_link %]" class="pvcslink">[% vcs_link %]</a></p>
-[% END; END; END %]
+   IF vcs_info %]
+ (<a href="[% vcs_info %]" class="pvcslink">[% vcs_name %]</a>)
+[% END %]
+</li>
+[% END; END %]
+
+</ul>
 
 [% IF src %]
   <p>Download Source Package <a href="[% src.url %]">[% src.pkg %]</a>:
 
 [% IF maintainers.size == 1 -%]
   <h3>Maintainer:</h3>
-  [%- FOREACH maintainers -%]
-       <a href="mailto:[% mail %]">[% name | html %]</a>
-       (<a href="[% ddpo_url _ mail %]" title="An overview over the maintainer's packages and uploads">QA Page</a>)
-  [%- END -%]
 [%- ELSE -%]
   <h3>Maintainers:</h3>
-  [%- FOREACH maintainers -%]
-    [%- '<ul>' IF loop.first -%]
+[%- END %]
+[%- FOREACH maintainers -%]
+  [%- '<ul>' IF loop.first -%]
        <li><a href="mailto:[% mail %]">[% name | html %]</a>
        (<a href="[% ddpo_url _ mail %]" title="An overview over the maintainer's packages and uploads">QA Page</a>)
        </li>
-    [%- '</ul>' IF loop.last -%]
-  [%- END -%]
-[%- END %]
+  [%- '</ul>' IF loop.last -%]
+[%- END -%]
 
 [% url = page.get_newest('url');
+   SET url = page.get_newest('homepage') IF page.get_newest('homepage');
    IF url %]
 <h3>External Resources:</h3>
-<p>Homepage: <a href="[% url | uri %]">[% url | html %]</a></p>
+<ul>
+<li><a href="[% url | uri %]">Homepage</a> [[% extract_host(url) %]]</li>
+</ul>
+[% END %]
+
+[% FOREACH sim IN similar %]
+       [% IF loop.first %]
+       <h3>Similar packages:</h3>
+       <ul>
+       [% END %]
+       <li><a href="/[% sim %]">[% sim %]</a></li>
+       [% '</ul>' IF loop.last %]
 [% END %]
 
 </div> <!-- end pmoreinfo -->
@@ -206,14 +217,14 @@ Do not install it on a normal Debian system.</p>
     <div id="pdeps">
     <h2>Other Packages Related to [% pkg %]</h2>
 
-    <table id="pdeplegend" summary="legend"><tr>
+    <table id="pdeplegend" class="visual" summary="legend"><tr>
     [% IF is_source %]
-    <td><img src="/Pics/adep.gif" alt="[adep]" width="16" height="16">= build-depends</td>
-    <td><img src="/Pics/idep.gif" alt="[idep]" width="16" height="16">= build-depends-indep</td>
+    <td><ul class="uladep"><li>build-depends</li></ul></td>
+    <td><ul class="ulidep"><li>build-depends-indep</li></ul></td>
     [% ELSE %]
-    <td><img src="/Pics/dep.gif" alt="[dep]" width="16" height="16">= depends</td>
-    <td><img src="/Pics/rec.gif" alt="[rec]" width="16" height="16">= recommends</td>
-    <td><img src="/Pics/sug.gif" alt="[sug]" width="16" height="16">= suggests</td>
+    <td><ul class="uldep"><li>depends</li></ul></td>
+    <td><ul class="ulrec"><li>recommends</li></ul></td>
+    <td><ul class="ulsug"><li>suggests</li></ul></td>
     [% END %]
     </tr></table>
   [%- END %]
@@ -223,7 +234,7 @@ Do not install it on a normal Debian system.</p>
     [% '<li>' UNLESS is_old_pkgs %]
     [% FOREACH alternatives %]
       [% '<dl>' IF loop.first %]
-      <dt>[% IF loop.first %]<img class="hidecss" src="/Pics/[% id %].gif" alt="[[% id %]]">[% ELSE %]or [% END %]
+      <dt>[% IF loop.first %]<span class="nonvisual">[% id %]:</span>[% ELSE %]or [% END %]
        [% IF suite %]<a href="[% make_url(name,'','suite',suite,'source','') %]">[% name %]</a>[% ELSE %][% name %][% END %]
        [% ' (' _ version _ ')' IF version %]
         [% ' [' _ arch_str _ ']' IF arch_str %]</dt>
@@ -309,10 +320,24 @@ Do not install it on a normal Debian system.</p>
   [% IF loop.last -%]
     </table>
 
+[% FOREACH vcs IN known_vcs;
+       vcs_id = vcs.0; vcs_name = vcs.1; vcs_pkg = vcs.2;
+       vcs_info = page.get_newest("vcs-$vcs_id");
+       SET vcs_info = page.get_newest("x-vcs-$vcs_id") UNLESS vcs_info;
+       IF vcs_info; %]
+<dl>
+<dt>Debian Package Source Repository (<acronym title="Version Control System">VCS</acronym>: <a href="[% make_url(vcs_pkg,'','source','') %]">[% vcs_name %]</a>)</dt>
+<dd><a href="[% vcs_info %]" class="pvcslink">[% vcs_info %]</a></dd>
+[% IF vcs_link %]
+<dt>Debian Package Source Repository (Browsable)</dt><dd><a href="[% vcs_link %]" class="pvcslink">[% vcs_link %]</a></dd>
+[% END %]
+</dl>
+[% END; END %]
+
     </div> <!-- end pdownload -->
   [%- END %]
 [% END %]
 
-<script type="text/javascript">init_tab_list("ptablist")</script>
+[%# <script type="text/javascript">init_tab_list("ptablist")</script> %]
 
 [%- PROCESS 'html/foot.tmpl' -%]
index ab8c4734f7bb0c4b3525268586f376994b48348b..12e249cc6b081ebd1d552bd0c44047b6bf53b9d5 100644 (file)
@@ -6,12 +6,12 @@ Copyright (C) [% copyright.years %] [% copyright.name %];
 See <URL:[% license.url %]> for the license terms.
 
 [% FOREACH packages -%]
-  [%- BLOCK marker %] [[% text %][% END -%]
+  [%- BLOCK marker %] [[% text %]][% END -%]
   [%- BLOCK markers -%]
     [%- PROCESS marker text=section IF section != main_section -%]
     [%- PROCESS marker text=archive IF archive != main_archive -%]
   [%- END -%]
-  [%- IF providers %]
+  [%- IF providers.size %]
 [% name %] virtual package provided by [% providers.join(', ') %]
   [%- END -%]
   [%- IF versions %]