From: Torsten Werner Date: Fri, 11 Mar 2011 22:13:28 +0000 (+0100) Subject: Handle empty packages in 'dak contents scan'. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecd2ca44852b942c1af7cf1d9906c6bab8159fc1;p=dak Handle empty packages in 'dak contents scan'. Signed-off-by: Torsten Werner --- diff --git a/daklib/contents.py b/daklib/contents.py index 056da53f..4a6330f8 100755 --- a/daklib/contents.py +++ b/daklib/contents.py @@ -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: