]> git.donarmstrong.com Git - dak.git/commitdiff
daklib/archive.py: don't fail in prepare() if the .dsc is invalid
authorAnsgar Burchardt <ansgar@debian.org>
Tue, 18 Dec 2012 15:37:36 +0000 (16:37 +0100)
committerAnsgar Burchardt <ansgar@debian.org>
Tue, 18 Dec 2012 15:41:29 +0000 (16:41 +0100)
We only need the .dsc here to try and grab any files not included in the
upload. If there is an error loading the .dsc, do not throw an exception here,
but do so later instead.

daklib/archive.py

index ca58da87a2858917fda4387173f54fde3796d396..806ba40211b82d31ee6840aa8e8e48e9c6875436 100644 (file)
@@ -652,7 +652,13 @@ class ArchiveUpload(object):
                     continue
                 fs.copy(src, dst, mode=0o640)
 
-            source = self.changes.source
+            source = None
+            try:
+                source = self.changes.source
+            except Exception:
+                # Do not raise an exception here if the .dsc is invalid.
+                pass
+
             if source is not None:
                 for f in source.files.itervalues():
                     src = os.path.join(self.original_directory, f.filename)