chiark / gitweb /
WIP nmu before go back and fill in more
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 28 Dec 2016 13:47:34 +0000 (13:47 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jan 2017 01:36:00 +0000 (01:36 +0000)
dgit

diff --git a/dgit b/dgit
index c51085698689bac7f574d91bc2784212bca7b381..98499d4676da1ce592c92a9371b24a7ff75a9698 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -611,6 +611,8 @@ our %defcfg = ('dgit.default.distro' => 'debian',
 # ^ this is a workaround but works (only) on DSA-administered machines
               'dgit-distro.debian.git-url' => 'https://git.dgit.debian.org',
               'dgit-distro.debian.git-url-suffix' => '',
+              'dgit-distro.debian.nmu-bug-new' => 'submit@bugs.debian.org',
+              'dgit-distro.debian.nmu-bug-old' => '@bugs.debian.org',
               'dgit-distro.debian.upload-host' => 'ftp-master', # for dput
               'dgit-distro.debian.mirror' => 'http://ftp.debian.org/debian/',
  'dgit-distro.debian-security.archive-query' => 'aptget:',
@@ -4044,21 +4046,18 @@ sub nmudiff_email_prepare ($) {
        die $donmudiff;
     }
 
+    my (@header, @psuedoheader, @body);
+
     my @closes = split /\s+/, $dctrl->{Closes} // '';
     if (@closes==1) {
-       push @header, <<END;
-To: $closes[0]\@$domain
-Subject: #$closes[0]: Fixed in NMU ($package $version)
-END
+       push @header,
+           To => $closes[0].'@'.(access_cfg 'nmu-bug-old'),
+           Subject => "#$closes[0]: Fixed in NMU ($package $version)";
     } else {
-       push @header, <<END;
-To: $newbug
-Subject: $source: diff for NMU version $version
-END
+       push @header,
+         To => (access_cfg 'nmu-bug-new'),
+         Subject => "$source: diff for NMU version $version";
     }
-    push @header, <<END:
-X-Mailer: dgit ($our_version)
-END
 
     push @body, <<END;
 Dear Maintainer,
@@ -4121,6 +4120,25 @@ may want to rebase the dgit branch onto your own history.
 END
     }
 
+    my $msg = build MIME::Entity @header,
+       'Boundary' => "dgit-$current",
+       'Content-Type' => 'multipart/mixed';
+
+    $msg->attach(Charset => 'utf-8',
+                Data => (join "", @pseudoheader, "\n", @body),
+                Encoding => '-SUGGEST');
+
+    $msg->attach(Charset => 'utf-8',
+                Path => output of git diff,
+                Description => "NMU diff for $version",
+                Filename => "${package}_${version}_nmu.diff",
+                Disposition => 'attachment'
+    
+
+    prepend dgit to x-mailer
+    push @header,
+       'X-Mailer' => "dgit ($our_version)"
+
 sub dopush () {
     printdebug "actually entering push\n";