]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #32926 - caipre:rustbuild-verify-download, r=alexcrichton
authorManish Goregaokar <manishsmail@gmail.com>
Fri, 15 Apr 2016 19:46:43 +0000 (01:16 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Fri, 15 Apr 2016 19:48:01 +0000 (01:18 +0530)
rustbuild: Verify sha256 of downloaded tarballs

Here's a quick first pass at this.

I don't use Python often enough to claim that this is totally Pythonic. I've left off some (almost certainly unnecessary) error handling regarding opening and processing files. The whole tarball is read into memory to calculate the hash, but the file isn't *so* large so that should be fine. I don't care for the output from `raise RuntimeError`, but that's how `run()` does it so I'm following precedent.

Tested by manually changing the value of `expected`, and by modifying the tarball then forcing `rustc_out_of_date()`. Both cases tripped the error.

Closes https://github.com/rust-lang/rust/issues/32902


Trivial merge