]> git.decadent.org.uk Git - dak.git/commitdiff
Handle empty packages in 'dak contents scan'.
authorTorsten Werner <twerner@debian.org>
Fri, 11 Mar 2011 22:13:28 +0000 (23:13 +0100)
committerTorsten Werner <twerner@debian.org>
Fri, 11 Mar 2011 22:13:28 +0000 (23:13 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/contents.py

index 056da53f18d244c8ed28a51a440d0dac364d3c11..4a6330f827fdd349306890f14a09196af457ac8d 100755 (executable)
@@ -252,8 +252,12 @@ class ContentsScanner(object):
         '''
         session = DBConn().session()
         binary = session.query(DBBinary).get(self.binary_id)
+        empty_package = True
         for filename in binary.scan_contents():
             binary.contents.append(BinContents(file = filename))
+            empty_package = False
+        if empty_package:
+            binary.contents.append(BinContents(file = 'EMPTY_PACKAGE'))
         try:
             session.commit()
         except IntegrityError: