]> err.no Git - dak/commitdiff
daklib/archive.py: ignore missing source files when copying to temporary directory
authorAnsgar Burchardt <ansgar@debian.org>
Sat, 11 Aug 2012 17:27:53 +0000 (19:27 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Sun, 12 Aug 2012 07:30:39 +0000 (09:30 +0200)
daklib/archive.py

index 463c3de246c3bd9b9df6ecbd3d67e11b24f0be61..1887b784a29c2f7d1b32b19a59049ac8f65956db 100644 (file)
@@ -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