X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fprocess_upload.py;h=93d30f85d672944842f4a8e54111e2bd76868fe6;hb=07ad10059f7d5c840d1e1a26b28e518408435110;hp=727e2e802ea27f5ddfed10157c3a542619699dd6;hpb=691ed711258ec04185e9ba8994e9c301564eb847;p=dak.git diff --git a/dak/process_upload.py b/dak/process_upload.py index 727e2e80..93d30f85 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'), @@ -286,8 +290,10 @@ def accept(directory, upload): for suite in upload.final_suites: accepted_to_real_suite = accepted_to_real_suite or suite.policy_queue is None + sourceful_upload = 'source' in upload.changes.architectures + control = upload.changes.changes - if 'source' in upload.changes.architectures and not Options['No-Action']: + if sourceful_upload and not Options['No-Action']: urgency = control.get('Urgency') if urgency not in cnf.value_list('Urgency::Valid'): urgency = cnf['Urgency::Default'] @@ -299,7 +305,7 @@ def accept(directory, upload): utils.send_mail(message) # send mail to announce lists and tracking server - if accepted_to_real_suite: + if accepted_to_real_suite and sourceful_upload: subst = subst_for_upload(upload) announce = set() for suite in upload.final_suites: @@ -320,7 +326,7 @@ def accept(directory, upload): # Only close bugs for uploads that were not redirected to a policy queue. # process-policy will close bugs for those once they are accepted. subst = subst_for_upload(upload) - if accepted_to_real_suite and cnf.find_b('Dinstall::CloseBugs') and upload.changes.source is not None: + if accepted_to_real_suite and cnf.find_b('Dinstall::CloseBugs') and sourceful_upload: for bugnum in upload.changes.closed_bugs: subst['__BUG_NUMBER__'] = str(bugnum)