Ubuntu Pastebin

Paste from cjwatson at Fri, 14 Oct 2016 20:47:53 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
=== modified file 'lib/lp/soyuz/mail/packageupload.py'
--- lib/lp/soyuz/mail/packageupload.py	2015-09-02 12:05:15 +0000
+++ lib/lp/soyuz/mail/packageupload.py	2016-10-14 20:47:45 +0000
@@ -148,6 +148,8 @@ def fetch_information(spr, bprs, changes
                 changes.get('Maintainer'), 'Maintainer')
         except ParseMaintError:
             pass
+        notify_changed_by = changes.get(
+            'Launchpad-Notify-Changed-By', '') == 'yes'
     elif spr or bprs:
         if not spr and bprs:
             spr = bprs[0].build.source_package_release
@@ -160,12 +162,14 @@ def fetch_information(spr, bprs, changes
             maintainer = (
                 spr.maintainer.displayname,
                 spr.maintainer.preferredemail.email)
+        notify_changed_by = False
 
     return {
         'changelog': changelog,
         'date': date,
         'changedby': changedby,
         'maintainer': maintainer,
+        'notify_changed_by': notify_changed_by,
         }
 
 
@@ -343,7 +347,7 @@ class PackageUploadMailer(BaseMailer):
             # confuse them.
             pass
         else:
-            # If this is not a PPA, we also consider maintainer and changed-by.
+            # If this is not a PPA, we also consider maintainer.
             if blamee is not None:
                 if is_valid_uploader(maintainer, distroseries.distribution):
                     debug(logger, "Adding maintainer to recipients")
@@ -352,6 +356,10 @@ class PackageUploadMailer(BaseMailer):
                         PackageUploadRecipientReason.forMaintainer,
                         logger=logger)
 
+            # If this is not a PPA, or if the "Launchpad-Notify-Changed-By:
+            # yes" field is set in the .changes file, we also consider
+            # changed-by.
+            if blamee is not None or info['notify_changed_by']:
                 if is_valid_uploader(changer, distroseries.distribution):
                     debug(logger, "Adding changed-by to recipients")
                     add_recipient(
Download as text