From 25d2c2a5adf89a13412d48ae2908bf0a104a6799 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Tue, 7 Aug 2012 16:06:07 +0200 Subject: [PATCH] daklib/archive.py: check for source when copying binaries --- daklib/archive.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/daklib/archive.py b/daklib/archive.py index 539a8d20..b96b9892 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -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) -- 2.39.5