Rollup merge of #39660 - alexcrichton:shasum-dirs, r=brson

Don't include directory names in shasums

Right now we just run `shasum` on an absolute path but right now the shasum
files only include filenames, so let's use `current_dir` and just the file name
to only have the file name emitted.
This commit is contained in:
Corey Farwell 2017-02-10 23:41:33 -05:00 committed by GitHub
commit bf750890c9

View File

@ -362,7 +362,8 @@ impl Builder {
fn hash(&self, path: &Path) -> String {
let sha = t!(Command::new("shasum")
.arg("-a").arg("256")
.arg(path)
.arg(path.file_name().unwrap())
.current_dir(path.parent().unwrap())
.output());
assert!(sha.status.success());