From af69a21e4ac395e2f1ee467dbc6d9a76f6fcb64f Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Mon, 20 Aug 2012 10:27:28 +0200 Subject: [PATCH] daklib/archive.py: use first component for NEW packages if we don't have a better guess --- daklib/archive.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() -- 2.39.5