[dak/master] Add support for warnings.
---
dak/process_upload.py | 2 ++
daklib/announce.py | 3 +++
daklib/archive.py | 10 ++++++++++
templates/process-unchecked.accepted | 3 +++
4 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/dak/process_upload.py b/dak/process_upload.py
index 0f89f46..ca210c3 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 fdc3e46..08fd3f1 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 0f3a316..c2cc839 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 0fc0318..efc16ec 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__.
--
1.7.2.5
Reply to: