[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#824085: packages.debian.org: please fix @p.d.o email aliases to forward to tracker.debian.org (and more)



Package: www.debian.org
Severity: important
Tags: patch

As per
https://lists.debian.org/debian-devel-announce/2015/12/msg00001.html all
emails sent to @packages.qa.debian.org should now be sent to
@tracker.debian.org.

I have prepared a patch implementing this for the @packages.debian.org
email aliases. Please find it attached.

My patch also makes sure to ignore maintainer address that are in
@packages.debian.org (to avoid mail loops). This makes it possible
to not create a mailing list for co-maintenance and just use
tracker.debian.org to subscribe to the package (while listing the @p.d.o
alias in Maintainer).

Thank you in advance!

PS: The patch is to applied on
picconi.debian.org:/srv/packages.debian.org/bin/build-maintainerdb

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (500, 'oldstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.5.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- 
Raphaël Hertzog ◈ Debian Developer

Support Debian LTS: http://www.freexian.com/services/debian-lts.html
Learn to master Debian: http://debian-handbook.info/get/
--- /srv/packages.debian.org/bin/build-maintainerdb	2013-10-02 11:42:37.255082956 +0000
+++ bin/build-maintainerdb	2015-12-15 15:48:02.989559788 +0000
@@ -35,7 +35,7 @@
     print "\nInternal Error: Cannot open configuration file.\n\n";
     exit 0;
 }
-my $topdir = "/org/packages.debian.org";
+my $topdir = "/srv/packages.debian.org";
 my $localdir = "/srv/mirrors/debian/";
 
 while (<C>) {
@@ -44,8 +44,8 @@
 }
 close (C);
 
-#my $maildomain = "packages.debian.org";
-my $ptsdomain = "packages.qa.debian.org";
+my $maildomain = "packages.debian.org";
+my $trackerdomain = "tracker.debian.org";
 
 
 my $maintainerfile = "$localdir/indices/Maintainers";
@@ -119,6 +119,22 @@
     return $addr;
 }
 
+sub add_maintainer
+{
+    my $package = shift;
+    my $email = shift;
+
+    $maint{$package} //= "";
+
+    if ($email =~ /\Q$maildomain\E$/) {
+	return;  # Do not register emails in @packages.debian.org pointing to us
+    }
+
+    $maint{$package} .= " " if ($maint{$package});
+    $maint{$package} .= $email;
+    printf "  ADD (%s, %s)\n", $package, $email if ($opt_verbose > 2);
+}
+
 sub read_maintainer
 {
     my $file = shift;
@@ -136,20 +152,13 @@
 	if (! exists $maint{$package}) {
 	    printf "  EVAL (%s, \"%s\")\n", $package, $maint if ($opt_verbose > 2);
 
-		if (exists $maint{$package}) {
-		    $maint{$package} .= " ";
-		    printf "  EXPAND (%s)\n", $package if ($opt_verbose > 2);
-		}
-		if ($maint =~ /.*<(.*)>/) {
-		    $maint{$package} .= $1;
-		    printf "  ADD (%s, %s)\n", $package, $1 if ($opt_verbose > 2);
-		} elsif ($maint =~ /\s*(\S+)\s+\(.*\)/) {
-		    $maint{$package} .= $1;
-		    printf "  ADD (%s, %s)\n", $package, $1 if ($opt_verbose > 2);
-		} else {
-		    $maint{$package} .= $maint;
-		    printf "  ADD (%s, %s)\n", $package, $maint if ($opt_verbose > 2);
-		}
+	    if ($maint =~ /.*<(.*)>/) {
+		add_maintainer($package, $1);
+	    } elsif ($maint =~ /\s*(\S+)\s+\(.*\)/) {
+		add_maintainer($package, $1);
+	    } else {
+		add_maintainer($package, $maint);
+	    }
 
 	    printf "  %s: %s\n", $package, $maint{$package} if ($opt_verbose > 1);
 
@@ -191,13 +200,12 @@
     open (CALLOUT, ">$calloutfile.new") || die "Can't open $file.new, $!";
     my $forward;
     foreach my $package (sort(keys(%maint))) {
-# 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";
+	    $forward = "dispatch+$binsrc{$package}_contact\@$trackerdomain";
+	} else {
+	    $forward = "dispatch+${package}_contact\@$trackerdomain";
 	}
+	$forward .= ", $maint{$package}" if $maint{$package};
 	printf "%s -> %s\n", $package, $forward if ($opt_verbose);
 	printf CONF "%s:\t%s\n", $package, $forward;
 	printf WRITE "+%d,%d:%s->%s\n", length($package), length($forward), $package, $forward;

Reply to: