]> git.decadent.org.uk Git - dak.git/commitdiff
dak/process_new.py: fix handling binary-only NEW uploads
authorAnsgar Burchardt <ansgar@debian.org>
Tue, 7 May 2013 06:25:23 +0000 (08:25 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Tue, 7 May 2013 06:28:41 +0000 (08:28 +0200)
For a binary-only (buildd) upload that ends in NEW, upload.source is None. So
we have to get the source package name from somewhere else.

dak/process_new.py

index 92104435ae1552ab4bd529f640a92e0cd3884e3a..4b0d5c36cd3e153d0f8a3e5bed1a1ae9a018d0d4 100755 (executable)
@@ -126,6 +126,7 @@ def takenover_binaries(upload, missing, session):
         if m['type'] != 'dsc':
             binaries.remove(m['package'])
     if binaries:
+        source = binaries[0].source.source
         suite = upload.target_suite.overridesuite or \
                     upload.target_suite.suite_name
         suites = [s[0] for s in session.query(Suite.suite_name).filter \
@@ -134,7 +135,7 @@ def takenover_binaries(upload, missing, session):
         rows = session.query(DBSource.source, DBBinary.package).distinct(). \
                              filter(DBBinary.package.in_(binaries)). \
                              join(DBBinary.source). \
-                             filter(DBSource.source != upload.source.source). \
+                             filter(DBSource.source != source). \
                              join(DBBinary.suites). \
                              filter(Suite.suite_name.in_(suites)). \
                              order_by(DBSource.source, DBBinary.package).all()