From 650ec31aaf1883f5f866b5245db14bdf4cf196f7 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Thu, 20 Sep 2012 12:17:36 +0200 Subject: [PATCH] daklib/command.py: process all sections and not only the first one --- daklib/command.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/daklib/command.py b/daklib/command.py index a3092f6f..88f65558 100644 --- a/daklib/command.py +++ b/daklib/command.py @@ -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 -- 2.39.2