]> git.decadent.org.uk Git - dak.git/commitdiff
don't send mails about accepted buildd uploads to maintainer
authorAnsgar Burchardt <ansgar@debian.org>
Sun, 12 Aug 2012 13:54:59 +0000 (15:54 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 12 Aug 2012 13:54:59 +0000 (15:54 +0200)
dak/process_policy.py
dak/process_upload.py

index 695751c457de1e2bf46684fb6381fb866ca22b48..98c4c2981e4ba310233a5dd309a668620f6c53e8 100755 (executable)
@@ -278,7 +278,10 @@ def subst_for_upload(upload):
     cnf = Config()
 
     maintainer_field = upload.changes.changedby or upload.changes.maintainer
-    addresses = utils.mail_addresses_for_upload(upload.changes.maintainer, maintainer_field, upload.changes.fingerprint)
+    if upload.source is not None:
+        addresses = utils.mail_addresses_for_upload(upload.changes.maintainer, maintainer_field, upload.changes.fingerprint)
+    else:
+        addresses = utils.mail_addresses_for_upload(upload.changes.maintainer, upload.changes.maintainer, upload.changes.fingerprint)
 
     changes_path = os.path.join(upload.policy_queue.path, upload.changes.changesname)
     changes_contents = open(changes_path, 'r').read()
index 727e2e802ea27f5ddfed10157c3a542619699dd6..23a2036407b1c30c410e85f8b0ff481fb0054d50 100755 (executable)
@@ -237,9 +237,13 @@ def subst_for_upload(upload):
                 suite_names.append(suite.suite_name)
         suite_name = ','.join(suite_names)
 
-    maintainer_field = control.get('Changed-By', control.get('Maintainer', cnf['Dinstall::MyEmailAddress']))
-    maintainer = fix_maintainer(maintainer_field)
-    addresses = utils.mail_addresses_for_upload(control.get('Maintainer', cnf['Dinstall::MyEmailAddress']), maintainer_field, changes.primary_fingerprint)
+    maintainer_field = control.get('Maintainer', cnf['Dinstall::MyEmailAddress'])
+    changed_by_field = control.get('Changed-By', maintainer_field)
+    maintainer = fix_maintainer(changed_by_field)
+    if upload.changes.source is not None:
+        addresses = utils.mail_addresses_for_upload(maintainer_field, changed_by_field, changes.primary_fingerprint)
+    else:
+        addresses = utils.mail_addresses_for_upload(maintainer_field, maintainer_field, changes.primary_fingerprint)
 
     bcc = 'X-DAK: dak process-upload'
     if 'Dinstall::Bcc' in cnf:
@@ -260,7 +264,7 @@ def subst_for_upload(upload):
         '__DAK_ADDRESS__': cnf['Dinstall::MyEmailAddress'],
         '__MAINTAINER_FROM__': maintainer[1],
         '__MAINTAINER_TO__': ", ".join(addresses),
-        '__MAINTAINER__': maintainer_field,
+        '__MAINTAINER__': changed_by_field,
         '__BCC__': bcc,
 
         '__BUG_SERVER__': cnf.get('Dinstall::BugServer'),