From: Ansgar Burchardt Date: Mon, 20 Aug 2012 08:27:28 +0000 (+0200) Subject: daklib/archive.py: use first component for NEW packages if we don't have a better... X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=af69a21e4ac395e2f1ee467dbc6d9a76f6fcb64f;p=dak.git daklib/archive.py: use first component for NEW packages if we don't have a better guess --- diff --git a/daklib/archive.py b/daklib/archive.py index 77f400b4..08f59883 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -1188,8 +1188,9 @@ class ArchiveUpload(object): source_component_name = guess break if source_component_name is None: - raise Exception('Could not guess source component.') - source_component = self.session.query(Component).filter_by(component_name=source_component_name).one() + source_component = self.session.query(Component).order_by(Component.component_id).first() + else: + source_component = self.session.query(Component).filter_by(component_name=source_component_name).one() source_component_func = lambda source: source_component db_changes = self._install_changes()