From 235b9c428664ce68b90b847e02400a5cd6adc5e4 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Sun, 12 Aug 2012 15:54:59 +0200 Subject: [PATCH] don't send mails about accepted buildd uploads to maintainer --- dak/process_policy.py | 5 ++++- dak/process_upload.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/dak/process_policy.py b/dak/process_policy.py index 695751c4..98c4c298 100755 --- a/dak/process_policy.py +++ b/dak/process_policy.py @@ -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() diff --git a/dak/process_upload.py b/dak/process_upload.py index 727e2e80..23a20364 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -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'), -- 2.39.5