aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/bootstrap_commands.py
diff options
context:
space:
mode:
authorMs2ger <Ms2ger@gmail.com>2015-11-27 09:47:38 +0100
committerMs2ger <Ms2ger@gmail.com>2015-11-27 09:47:38 +0100
commit21f532758b35cc9a266dd1ffeb47bb1afefba876 (patch)
tree3a6cbcffb988d7fee64b1fa62274e2e9b0edaefc /python/servo/bootstrap_commands.py
parenta515fe320b78758dedcb94848ae7b9a3fbd73fca (diff)
downloadservo-21f532758b35cc9a266dd1ffeb47bb1afefba876.tar.gz
servo-21f532758b35cc9a266dd1ffeb47bb1afefba876.zip
Ensure the bootstrap-rust-docs and doc mach commands agree on the location of the Rust documentation.
Diffstat (limited to 'python/servo/bootstrap_commands.py')
-rw-r--r--python/servo/bootstrap_commands.py9
1 files changed, 4 insertions, 5 deletions
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)