From: Ansgar Burchardt Date: Wed, 19 Sep 2012 08:49:07 +0000 (+0200) Subject: Add support for warnings. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=31de75724c3cf43d635c55cd18953329a87032b1;p=dak.git Add support for warnings. --- diff --git a/dak/process_upload.py b/dak/process_upload.py index 0f89f46b..ca210c30 100755 --- a/dak/process_upload.py +++ b/dak/process_upload.py @@ -251,6 +251,8 @@ def get_processed_upload(upload): pu.program = "process-upload" + pu.warnings = upload.warnings + return pu @try_or_reject diff --git a/daklib/announce.py b/daklib/announce.py index fdc3e468..08fd3f10 100644 --- a/daklib/announce.py +++ b/daklib/announce.py @@ -47,6 +47,8 @@ class ProcessedUpload(object): # program program = "unknown-program" + warnings = [] + def _subst_for_upload(upload): cnf = Config() @@ -79,6 +81,7 @@ def _subst_for_upload(upload): '__SOURCE__': upload.source, '__VERSION__': upload.version, '__ARCHITECTURE__': upload.architecture, + '__WARNINGS__': '\n'.join(upload.warnings), } override_maintainer = cnf.get('Dinstall::OverrideMaintainer') diff --git a/daklib/archive.py b/daklib/archive.py index 0f3a316e..c2cc8392 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -603,6 +603,16 @@ class ArchiveUpload(object): self._new_queue = self.session.query(PolicyQueue).filter_by(queue_name='new').one() self._new = self._new_queue.suite + def warn(self, message): + """add a warning message + + Adds a warning message that can later be seen in C{self.warnings} + + @type message: string + @param message: warning message + """ + self.warnings.append(message) + def prepare(self): """prepare upload for further processing diff --git a/templates/process-unchecked.accepted b/templates/process-unchecked.accepted index 0fc0318b..efc16ec3 100644 --- a/templates/process-unchecked.accepted +++ b/templates/process-unchecked.accepted @@ -9,7 +9,10 @@ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: __CHANGES_FILENAME__ ACCEPTED into __SUITE__ +__WARNINGS__ + Accepted: + __FILE_CONTENTS__ Thank you for your contribution to __DISTRO__.