]> git.decadent.org.uk Git - dak.git/commitdiff
daklib/archive.py: check for source when copying binaries
authorAnsgar Burchardt <ansgar@debian.org>
Tue, 7 Aug 2012 14:06:07 +0000 (16:06 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Thu, 9 Aug 2012 11:44:16 +0000 (13:44 +0200)
daklib/archive.py

index 539a8d20c55bde975a66c098baad0f657e369acb..b96b98924b837035e83b7f1e107157bbc174fcb2 100644 (file)
@@ -382,8 +382,14 @@ class ArchiveTransaction(object):
         if archive.tainted:
             allow_tainted = True
 
-        # make sure built-using packages are present in target archive
         filename = db_binary.poolfile.filename
+
+        # make sure source is present in target archive
+        db_source = db_binary.source
+        if session.query(ArchiveFile).filter_by(archive=archive, file=db_source.poolfile).first() is None:
+            raise ArchiveException('{0}: cannot copy to {1}: source is not present in target archive'.format(filename, suite.suite_name))
+
+        # make sure built-using packages are present in target archive
         for db_source in db_binary.extra_sources:
             self._ensure_extra_source_exists(filename, db_source, archive, extra_archives=extra_archives)