]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/util.rs
Remove the source archive functionality of ArchiveWriter
[rust.git] / src / bootstrap / util.rs
index 710b3588b845bf9b874e6ca6003cead1252be4e9..4b2b058a780f6df814a5899f908d938aac755d21 100644 (file)
@@ -115,6 +115,14 @@ fn drop(&mut self) {
     }
 }
 
+/// Used for download caching
+pub(crate) fn program_out_of_date(stamp: &Path, key: &str) -> bool {
+    if !stamp.exists() {
+        return true;
+    }
+    t!(fs::read_to_string(stamp)) != key
+}
+
 /// Symlinks two directories, using junctions on Windows and normal symlinks on
 /// Unix.
 pub fn symlink_dir(config: &Config, src: &Path, dest: &Path) -> io::Result<()> {
@@ -455,7 +463,7 @@ fn dir_up_to_date(src: &Path, threshold: SystemTime) -> bool {
 }
 
 fn fail(s: &str) -> ! {
-    println!("\n\n{}\n\n", s);
+    eprintln!("\n\n{}\n\n", s);
     std::process::exit(1);
 }