From: Ansgar Burchardt Date: Sat, 11 Aug 2012 17:27:53 +0000 (+0200) Subject: daklib/archive.py: ignore missing source files when copying to temporary directory X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e1cb5368fd8bb1d42aee4e12b77794893417abf;p=dak daklib/archive.py: ignore missing source files when copying to temporary directory --- 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