]> err.no Git - dak/commitdiff
Add support for warnings.
authorAnsgar Burchardt <ansgar@debian.org>
Wed, 19 Sep 2012 08:49:07 +0000 (10:49 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Wed, 19 Sep 2012 09:46:04 +0000 (11:46 +0200)
dak/process_upload.py
daklib/announce.py
daklib/archive.py
templates/process-unchecked.accepted

index 0f89f46b8765c0be4a65eb55b791b95a0995b980..ca210c30a0c25f030cb485d3b2e678d26ad13d35 100755 (executable)
@@ -251,6 +251,8 @@ def get_processed_upload(upload):
 
     pu.program = "process-upload"
 
+    pu.warnings = upload.warnings
+
     return pu
 
 @try_or_reject
index fdc3e468555a4782adc22c586dd75f0e1a3ebaf6..08fd3f109d4bdb873e76a5c11fbfa2815f9af016 100644 (file)
@@ -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')
index 0f3a316e79f4f9a0c41959098cd6bccd422959ab..c2cc8392777ce9750e501b6a6e01bb308f301f4a 100644 (file)
@@ -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
 
index 0fc0318b9fecd391338ea993062ee2b9f8b55d64..efc16ec3569b6c95e97f0737038e1baf6c930b5d 100644 (file)
@@ -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__.