From 21f532758b35cc9a266dd1ffeb47bb1afefba876 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 27 Nov 2015 09:47:38 +0100 Subject: Ensure the bootstrap-rust-docs and doc mach commands agree on the location of the Rust documentation. --- python/servo/bootstrap_commands.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'python/servo/bootstrap_commands.py') diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 6c262de3e1a..23d807fdb0e 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -174,9 +174,8 @@ class MachCommands(CommandBase): help='Force download even if docs already exist') def bootstrap_rustc_docs(self, force=False): self.ensure_bootstrapped() - hash_dir = path.join(self.context.sharedir, "rust", - self.rust_snapshot_path().split("/")[0]) - docs_dir = path.join(hash_dir, "doc") + rust_root = self.config["tools"]["rust-root"] + docs_dir = path.join(rust_root, "doc") if not force and path.exists(docs_dir): print("Snapshot Rust docs already downloaded.", end=" ") print("Use |bootstrap-rust-docs --force| to download again.") @@ -187,12 +186,12 @@ class MachCommands(CommandBase): docs_name = self.rust_snapshot_path().replace("rustc-", "rust-docs-") snapshot_url = ("https://static-rust-lang-org.s3.amazonaws.com/dist/rust-docs-nightly-%s.tar.gz" % host_triple()) - tgz_file = path.join(hash_dir, 'doc.tar.gz') + tgz_file = path.join(rust_root, 'doc.tar.gz') download_file("Rust docs", snapshot_url, tgz_file) print("Extracting Rust docs...") - temp_dir = path.join(hash_dir, "temp_docs") + temp_dir = path.join(rust_root, "temp_docs") if path.isdir(temp_dir): shutil.rmtree(temp_dir) extract(tgz_file, temp_dir) -- cgit v1.2.3