]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/archive.py: use first component for NEW packages if we don't have a better...
authorAnsgar Burchardt <ansgar@debian.org>
Mon, 20 Aug 2012 08:27:28 +0000 (10:27 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Mon, 27 Aug 2012 21:06:57 +0000 (23:06 +0200)
daklib/archive.py

index 77f400b41a432eed66aa6439b9faea1081a90714..08f59883d06705c15507dde26c359c17c66a31aa 100644 (file)
@@ -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()