]> 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 848d9a7dc92ed1c19496badc68b7e37b1b64ce97..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<()> {