diff options
author | Anthony Miyaguchi <acmiyaguchi@gmail.com> | 2014-09-17 01:55:53 -0700 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2014-11-05 11:14:21 -0800 |
commit | 75b340a243f4740376497a52e1c2eb639d9ac827 (patch) | |
tree | 7d492042d30050168d569b94d9261ba15cb52acd /python/servo | |
parent | b27ec2b2231313055232bf9a55343d581e6ead98 (diff) | |
download | servo-75b340a243f4740376497a52e1c2eb639d9ac827.tar.gz servo-75b340a243f4740376497a52e1c2eb639d9ac827.zip |
Fixes #3353: rust snapshot downloads to home directory
Diffstat (limited to 'python/servo')
-rw-r--r-- | python/servo/bootstrap_commands.py | 4 | ||||
-rw-r--r-- | python/servo/command_base.py | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/python/servo/bootstrap_commands.py b/python/servo/bootstrap_commands.py index 536e6234497..825796ea311 100644 --- a/python/servo/bootstrap_commands.py +++ b/python/servo/bootstrap_commands.py @@ -67,7 +67,7 @@ class MachCommands(CommandBase): help='Force download even if a snapshot already exists') def bootstrap_rustc(self, force=False): rust_dir = path.join( - self.context.topdir, "rust", *self.rust_snapshot_path().split("/")) + self.context.sharedir, "rust", *self.rust_snapshot_path().split("/")) if not force and path.exists(path.join(rust_dir, "bin", "rustc")): print("Snapshot Rust compiler already downloaded.", end=" ") print("Use |bootstrap_rust --force| to download again.") @@ -96,7 +96,7 @@ class MachCommands(CommandBase): action='store_true', help='Force download even if cargo already exists') def bootstrap_cargo(self, force=False): - cargo_dir = path.join(self.context.topdir, "cargo") + cargo_dir = path.join(self.context.sharedir, "cargo") if not force and path.exists(path.join(cargo_dir, "bin", "cargo")): print("Cargo already downloaded.", end=" ") print("Use |bootstrap_cargo --force| to download again.") diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 72810efff0d..45c1b230eb2 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -54,6 +54,9 @@ class CommandBase(object): if not hasattr(self.context, "bootstrapped"): self.context.bootstrapped = False + if not hasattr(self.context, "sharedir"): + self.context.sharedir = path.join(path.expanduser("~/"), ".servo") + config_path = path.join(context.topdir, ".servobuild") if path.exists(config_path): self.config = toml.loads(open(config_path).read()) @@ -68,10 +71,10 @@ class CommandBase(object): self.config["tools"].setdefault("cargo-root", "") if not self.config["tools"]["system-rust"]: self.config["tools"]["rust-root"] = path.join( - context.topdir, "rust", *self.rust_snapshot_path().split("/")) + context.sharedir, "rust", *self.rust_snapshot_path().split("/")) if not self.config["tools"]["system-cargo"]: self.config["tools"]["cargo-root"] = path.join( - context.topdir, "cargo") + context.sharedir, "cargo") self.config.setdefault("build", {}) self.config["build"].setdefault("android", False) @@ -148,7 +151,7 @@ class CommandBase(object): Registrar.dispatch("bootstrap-rust", context=self.context) if not self.config["tools"]["system-cargo"] and \ not path.exists(path.join( - self.context.topdir, "cargo", "bin", "cargo")): + self.config["tools"]["cargo-root"], "bin", "cargo")): Registrar.dispatch("bootstrap-cargo", context=self.context) self.context.bootstrapped = True |