From 3b318805f9fdd55296dce28fa2fd552b15e9df83 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 28 Dec 2016 12:50:58 +0000 Subject: [PATCH] WIP nmu before do email stuff --- dgit | 103 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/dgit b/dgit index 19745818..c5108569 100755 --- a/dgit +++ b/dgit @@ -69,6 +69,7 @@ our $rmchanges; our $overwrite_version; # undef: not specified; '': check changelog our $quilt_mode; our $quilt_modes_re = 'linear|smash|auto|nofix|nocheck|gbp|dpm|unapplied'; +our $delayed; our $dodep14tag; our $split_brain_save; our $we_are_responder; @@ -590,6 +591,7 @@ our %defcfg = ('dgit.default.distro' => 'debian', 'dgit-distro.debian.git-check' => 'url', 'dgit-distro.debian.git-check-suffix' => '/info/refs', 'dgit-distro.debian.new-private-pushers' => 't', + 'dgit-distro.debian.nmudiff-qateam' => 'packages@qa.debian.org', 'dgit-distro.debian/push.git-url' => '', 'dgit-distro.debian/push.git-host' => 'push.dgit.debian.org', 'dgit-distro.debian/push.git-user-force' => 'dgit', @@ -4021,6 +4023,104 @@ sub sign_changes ($) { } } +sub nmudiff_email_prepare ($) { + my ($changes) = @_; + if ($donmudiff eq 'no') { + return; + } elsif ($donmudiff eq 'always') { + } elsif ($donmudiff eq 'auto') { + my %maints; + foreach my $f qw(Maintainer Uploaders) { + my $maints = $dsc->{$f}; + next unless defined $maints; + $maints{ $_->address }=1 foreach parse Mail::Address $maints; + } + return unless grep { defined && $maints{$_} }, + (access_cfg 'nmudiff-qateam', 'RETURN-UNDEF'), + (getfield $changes, 'Changed-By'); + progress + "NMU (neither QA nor Changed-By is in Maintainer/Uploaders)."; + } else { + die $donmudiff; + } + + my @closes = split /\s+/, $dctrl->{Closes} // ''; + if (@closes==1) { + push @header, <