diff --git a/src/main.rs b/src/main.rs index 61c2864..dcef492 100644 --- a/src/main.rs +++ b/src/main.rs @@ -89,6 +89,7 @@ impl Context { .read(true) .write(true) .create(true) + .truncate(true) .open(self.work.join(".lock"))?; file.try_lock_exclusive()?; Ok(file) @@ -468,8 +469,12 @@ impl Context { let tarball_prefix = format!("rust-docs-{}-{}", version, target); let tarball = format!("{}.tar.gz", self.dl_dir().join(&tarball_prefix).display()); let tarball_dir = format!("{}/rust-docs/share/doc/rust/html", tarball_prefix); + + // The `m` flag touches all extracted files, therefore setting their modification time + // to the current date. This will cause the sync to overwrite all remote files with the + // local files. run(Command::new("tar") - .arg("xf") + .arg("xfm") .arg(&tarball) .arg("--strip-components=6") .arg(&tarball_dir)