]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/command.py: process all sections and not only the first one
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 20 Sep 2012 10:17:36 +0000 (12:17 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 20 Sep 2012 10:17:36 +0000 (12:17 +0200)
daklib/command.py

index a3092f6f1c72e2ef732f8270a65ef0fca8c1f3a1..88f65558c5e9659fe31da57acd4c95a4e7fa4c4b 100644 (file)
@@ -62,20 +62,23 @@ class CommandFile(object):
     def _evaluate_sections(self, sections, session):
         session.rollback()
         try:
-            sections.next()
-            section = sections.section
-
-            action = section.get('Action', None)
-            if action is None:
-                raise CommandError('Encountered section without Action field')
-            self.result.append('Action: {0}'.format(action))
-
-            if action == 'dm':
-                self.action_dm(self.fingerprint, section, session)
-            elif action == 'break-the-archive':
-                self.action_break_the_archive(self.fingerprint, section, session)
-            else:
-                raise CommandError('Unknown action: {0}'.format(action))
+            while True:
+                sections.next()
+                section = sections.section
+
+                action = section.get('Action', None)
+                if action is None:
+                    raise CommandError('Encountered section without Action field')
+                self.result.append('Action: {0}'.format(action))
+
+                if action == 'dm':
+                    self.action_dm(self.fingerprint, section, session)
+                elif action == 'break-the-archive':
+                    self.action_break_the_archive(self.fingerprint, section, session)
+                else:
+                    raise CommandError('Unknown action: {0}'.format(action))
+
+                self.result.append('')
         except StopIteration:
             pass
         finally:
@@ -163,7 +166,6 @@ class CommandFile(object):
         self._notify_uploader()
 
         session.close()
-        self.log.log(['done', self.filename])
 
         return result