-$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
-$Id$
-
Proposal for URL layout
$ROOT/search <- search handling
# 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
#
# 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")) {
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
{
}
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);
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);
shift;
}
+&read_bin_src_mapping();
+
&read_maintainer ($overridefile);
&read_maintainer ($maintainerfile);
#
# 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.
# Should run after the mirror pulse. The mirror tends to finish by
# the ctime of rsync.log.* in ~archvsync.
#!/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
#
# 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;
# 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
# 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';
#!/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
# 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;
# 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
# 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;
# 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
# 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';
# 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
# 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;
#
# 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
do
echo "retrieve Releases(.gpg) $dist"
test -d us/${dist} || mkdir -p us/${dist}
- (cd us/${dist} &&
- rsync -t ${localdir}/dists/${dist}/Release us/${dist}/Release &&
- rsync -t ${localdir}/dists/${dist}/Release.gpg us/${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`
#
# Deb::Versions
-# $Id$
#
# Copyright 2003, 2004 Frank Lichtenheld <frank@lichtenheld.de>
#
#
# 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
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;
#
# 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;
-# $Id$
-#
# Taken from the webwml CVS tree (english/templates/language_names.wml)
package Packages::I18N::LanguageNames;
-# $Id$
-#
# Taken from the webwml CVS tree (english/templates/languages.wml)
package Packages::I18N::Languages;
}
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 );
#
# 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:
#
#
# 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
font-family: monospace;
}
#pdownload p {
- display: inline;
+ margin-left: 1em;
}
#pdownloadnotes {
[% PROCESS 'config/archive_layout.tmpl' %]
[% PROCESS 'config/mirrors.tmpl' %]
+[%- 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");
+-%]
[%- nav_arr = [ { prefix=>'Distribution:', title=>'Overview over this suite', url=>make_url('/','','source',''), name=>suite }, ];
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 } );
<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');
+ url = page.get_newest('homepage');
IF url %]
<h3>External Resources:</h3>
<p>Homepage: <a href="[% url | uri %]">[% url | html %]</a></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 %]
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 -%]