about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-08-14 09:34:18 -0700
committerGitHub <noreply@github.com>2016-08-14 09:34:18 -0700
commit92ae4ceb6c6563b983a046f5f273cc13247eb4b1 (patch)
treeca6cf014e7f126335a90f964bebc3844ba9da804 /src/tools
parent2e29b126b60a19f491e7f1845dd98df50700e37a (diff)
parentb3908d08ee477f550dcb0e3d23305dee77e2258b (diff)
downloadrust-92ae4ceb6c6563b983a046f5f273cc13247eb4b1.tar.gz
rust-92ae4ceb6c6563b983a046f5f273cc13247eb4b1.zip
Auto merge of #34366 - Diggsey:rust-src-pkg, r=brson
Produce source package in rust-installer format

See rust-lang/rust-buildbot#102

There may be a better way to do this, wasn't sure how to clean-up the `rust-src-image` directory when it's used by multiple make rules.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/tidy/src/cargo_lock.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/tools/tidy/src/cargo_lock.rs b/src/tools/tidy/src/cargo_lock.rs
index 4324db489b7..165dd52758e 100644
--- a/src/tools/tidy/src/cargo_lock.rs
+++ b/src/tools/tidy/src/cargo_lock.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 use std::path::Path;
+use std::ffi::OsStr;
 
 const CARGO_LOCK: &'static str = "Cargo.lock";
 
@@ -18,14 +19,15 @@ pub fn check(path: &Path, bad: &mut bool) {
     super::walk(path,
                 &mut |path| super::filter_dirs(path) || path.ends_with("src/test"),
                 &mut |file| {
-        let name = file.file_name().unwrap().to_string_lossy();
-        if name == CARGO_LOCK {
+        if let Some(CARGO_LOCK) = file.file_name().and_then(OsStr::to_str) {
             let rel_path = file.strip_prefix(path).unwrap();
+            let git_friendly_path = rel_path.to_str().unwrap().replace("\\", "/");
             let ret_code = Command::new("git")
-                                        .arg("diff-index")
-                                        .arg("--quiet")
+                                        .arg("diff")
+                                        .arg("--exit-code")
+                                        .arg("--patch")
                                         .arg("HEAD")
-                                        .arg(rel_path)
+                                        .arg(&git_friendly_path)
                                         .current_dir(path)
                                         .status()
                                         .unwrap_or_else(|e| {