From: Joerg Jaspert Date: Sun, 12 Aug 2012 14:10:46 +0000 (+0200) Subject: Merge remote-tracking branch 'ansgar/pu/multiarchive-2' X-Git-Url: https://git.decadent.org.uk/gitweb/?p=dak.git;a=commitdiff_plain;h=7fde9ba21a43d92c369dc85562aa3dc5c73461d3;hp=61d1e2b14d61c045dcc07cd177dec49af0c41c45 Merge remote-tracking branch 'ansgar/pu/multiarchive-2' * ansgar/pu/multiarchive-2: daklib/archive.py: use target suite as source_suite when installing to build queues daklib/archive.py: doc: only subqueries are accepted daklib/archive.py: use only enhanced suites as default source_suites don't send mails about accepted buildd uploads to maintainer dak/process_upload.py: include full changes file with signature Signed-off-by: Joerg Jaspert --- 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 bea8a10e..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,15 +264,12 @@ 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'), - # TODO: don't use private member - '__FILE_CONTENTS__': upload.changes._signed_file.contents, - - # __REJECT_MESSAGE__ + '__FILE_CONTENTS__': open(upload.changes.path, 'r').read(), } override_maintainer = cnf.get('Dinstall::OverrideMaintainer') diff --git a/daklib/archive.py b/daklib/archive.py index 2aaf86fd..9bb01069 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -125,11 +125,10 @@ class ArchiveTransaction(object): @type fingerprint: L{daklib.dbconn.Fingerprint} @param fingerprint: optional fingerprint - @type source_suites: list of L{daklib.dbconn.Suite} or C{True} + @type source_suites: SQLAlchemy subquery for C{daklib.dbconn.Suite} or C{True} @param source_suites: suites to copy the source from if they are not in C{suite} or C{True} to allow copying from any suite. - This can also be a SQLAlchemy (sub)query object. @type extra_source_archives: list of L{daklib.dbconn.Archive} @param extra_source_archives: extra archives to copy Built-Using sources from @@ -913,7 +912,7 @@ class ArchiveUpload(object): changed_by = get_or_set_maintainer(control.get('Changed-By', control['Maintainer']), self.session) if source_suites is None: - source_suites = self.session.query(Suite).join((VersionCheck, VersionCheck.reference_id == Suite.suite_id)).filter(VersionCheck.suite == suite).subquery() + source_suites = self.session.query(Suite).join((VersionCheck, VersionCheck.reference_id == Suite.suite_id)).filter(VersionCheck.check == 'Enhances').filter(VersionCheck.suite == suite).subquery() source = self.changes.source if source is not None: @@ -1129,8 +1128,9 @@ class ArchiveUpload(object): # copy to build queues if policy_queue is None or policy_queue.send_to_build_queues: + source_suites = session.query(Suite).filter_by(suite_id=suite.suite_id).subquery() for build_queue in suite.copy_queues: - self._install_to_suite(build_queue.suite, source_component_func, binary_component_func, extra_source_archives=[suite.archive]) + self._install_to_suite(build_queue.suite, source_component_func, binary_component_func, source_suites=source_suites, extra_source_archives=[suite.archive]) self._do_bts_versiontracking()