#! /usr/bin/perl
# build-maintainerdb - convert several Packages files to maintainer database
-# Copyright (c) 1998,9,2001,3,4 Martin Schulze <joey@debian.org>
-
+# Copyright (c) 1998,9,2001,3,4,6 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.
# . Read maintainer changes from overrides file(s), need to rub
# out all existing entries
+use strict;
+use warnings;
+
# read the configuration
if (!open (C, "../config.sh")) {
- printf "\nInternal Error: Cannot open configuration file.\n\n";
+ print "\nInternal Error: Cannot open configuration file.\n\n";
exit 0;
}
+my $topdir = "/org/packages.debian.org";
while (<C>) {
$topdir = $1 if (/^\s*topdir="?(.*)"?\s*$/);
}
close (C);
-$maintainerfile = "$topdir/archive/Maintainers";
-$maintainerdb = "$topdir/files/maintainerdb";
-$overridefile = "$topdir/conf/maintainerdb.override";
+my $maildomain = "packages.debian.org";
+
+my $maintainerfile = "$topdir/archive/Maintainers";
+my $maintainerdb = "$topdir/conf/maintainer";
+my $overridefile = "$topdir/conf/maintainerdb.override";
+my @postcall = ( "/usr/sbin/postmap", $maintainerdb );
+my $opt_verbose = 0;
+
+my %maint;
sub package_maintainer
{
}
printf " %s: %s\n", $package, $maint{$package} if ($opt_verbose > 1);
- $pkgshort = "";
+ 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/) {
- $addrsave = $maint{$package} if ($opt_verbose > 1);
+ 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 ($pkg, $1, $maint{$pkgshort});
+ $maint{$pkgshort} = package_maintainer ($pkgshort, $1, $maint{$pkgshort});
}
}
} else {
printf "Writing to %s.new\n", $file if ($opt_verbose > 0);
open (CONF, ">$file.new") || die "Can't open $file.new, $!";
- foreach $package (sort(keys(%maint))) {
+ foreach my $package (sort(keys(%maint))) {
printf "%s -> %s\n", $package, $maint{$package} if ($opt_verbose > 1);
- printf CONF "%s:%s\n", $package, $maint{$package};
+ printf CONF "%s@%s\t%s\n", $package, $maildomain, $maint{$package};
}
close (CONF);
printf "Renaming to %s\n", $file if ($opt_verbose > 0);
system "mv -f $file.new $file";
+ printf "Executing @postcall\n" if ($opt_verbose > 0);
+ system @postcall;
}
sub help
#
# Main program
#
-$opt_verbose = 0;
while ($#ARGV > -1) {
if ($ARGV[0] eq "-v") {
$opt_verbose++;