From b3c124991cd5b258758384382fa527c02bd58d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 3 Apr 2024 15:05:44 +0200 Subject: [PATCH 1/2] Fix synchronization of docs --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 61c2864..05afd47 100644 --- a/src/main.rs +++ b/src/main.rs @@ -468,8 +468,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) From c882cad034a101757cc6dbb035ad5a9d833a2fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Wed, 3 Apr 2024 15:13:15 +0200 Subject: [PATCH 2/2] Fix clippy --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 05afd47..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)