]> err.no Git - dak/commitdiff
daklib/upload.py (Source): check hashes for .dsc before using it
authorAnsgar Burchardt <ansgar@debian.org>
Tue, 18 Sep 2012 20:08:53 +0000 (22:08 +0200)
committerAnsgar Burchardt <ansgar@debian.org>
Tue, 18 Sep 2012 21:21:15 +0000 (23:21 +0200)
This makes sure we have the correct file when accessing the source
property of a Changes object.

daklib/upload.py

index 447fa34a4805272b84adecd5126f69ec37426338..dcd008aae5e28aa1e81aea1240eb823c24ee488d 100644 (file)
@@ -439,6 +439,10 @@ class Source(object):
                     raise InvalidSourceException("Multiple .dsc found ({0} and {1})".format(self._dsc_file.filename, f.filename))
                 else:
                     self._dsc_file = f
+
+        # make sure the hash for the dsc is valid before we use it
+        self._dsc_file.check(directory)
+
         dsc_file_path = os.path.join(directory, self._dsc_file.filename)
         data = open(dsc_file_path, 'r').read()
         self._signed_file = SignedFile(data, keyrings, require_signature)