From 0e1cb5368fd8bb1d42aee4e12b77794893417abf Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Sat, 11 Aug 2012 19:27:53 +0200 Subject: [PATCH] daklib/archive.py: ignore missing source files when copying to temporary directory --- daklib/archive.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/daklib/archive.py b/daklib/archive.py index 463c3de2..1887b784 100644 --- a/daklib/archive.py +++ b/daklib/archive.py @@ -633,9 +633,14 @@ class ArchiveUpload(object): src = os.path.join(self.original_directory, f.filename) dst = os.path.join(self.directory, f.filename) if f.filename not in self.changes.files: - db_file = self.transaction.get_file(f, source.dsc['Source']) - db_archive_file = session.query(ArchiveFile).filter_by(file=db_file).first() - fs.copy(db_archive_file.path, dst, symlink=True) + try: + db_file = self.transaction.get_file(f, source.dsc['Source']) + db_archive_file = session.query(ArchiveFile).filter_by(file=db_file).first() + fs.copy(db_archive_file.path, dst, symlink=True) + except KeyError: + # Ignore if get_file could not find it. Upload will + # probably be rejected later. + pass def unpacked_source(self): """Path to unpacked source -- 2.39.5