summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-08-19 14:41:50 +0200
committerJürg Billeter <j@bitron.ch>2019-08-19 14:43:25 +0200
commitb06a8f005535a6bd95c55a79dd7a93e71b7cd5c5 (patch)
tree7f6abde30198e6c47fb9863585ef902b41694ca8
parentdd03a017f2fea55e5e4311df332a16891b0ec0ff (diff)
downloadbuildstream-juerg/ci-debug.tar.gz
_downloadablefilesource.py: Report size of downloaded file on errorjuerg/ci-debug
-rw-r--r--src/buildstream/plugins/sources/_downloadablefilesource.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/buildstream/plugins/sources/_downloadablefilesource.py b/src/buildstream/plugins/sources/_downloadablefilesource.py
index 2d53f8a56..c1013e3f1 100644
--- a/src/buildstream/plugins/sources/_downloadablefilesource.py
+++ b/src/buildstream/plugins/sources/_downloadablefilesource.py
@@ -142,8 +142,9 @@ class DownloadableFileSource(Source):
with self.timed_activity("Fetching {}".format(self.url), silent_nested=True):
sha256 = self._ensure_mirror()
if sha256 != self.ref:
- raise SourceError("File downloaded from {} has sha256sum '{}', not '{}'!"
- .format(self.url, sha256, self.ref))
+ size = os.path.getsize(self._get_mirror_file(sha256))
+ raise SourceError("File downloaded from {} is {} bytes and has sha256sum '{}', not '{}'!"
+ .format(self.url, size, sha256, self.ref))
def _warn_deprecated_etag(self, node):
etag = node.get_str('etag', None)