diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2015-01-28 10:33:04 -0800 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2015-01-28 10:33:04 -0800 |
commit | 53135b2566e9dc0ba10a39e85e6f30e07589cac9 (patch) | |
tree | e2f9df43aadd7927c0f513834dbe84f7f2b32455 | |
parent | 0f81e7088225d03b363e337a9d1da5ab36c44064 (diff) | |
download | servo-53135b2566e9dc0ba10a39e85e6f30e07589cac9.tar.gz servo-53135b2566e9dc0ba10a39e85e6f30e07589cac9.zip |
Move snapshot dir inside the source dir by default
This avoids changing any directories outside the repo, which is better for
some automation scenarios.
The servobuild.example file has a "cache-dir" setting that restores the
previous default location of `~/.servo`, which is useful for developers
working with multiple clones on the same machine.
-rw-r--r-- | python/servo/command_base.py | 8 | ||||
-rw-r--r-- | servobuild.example | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 32c6b2538c9..3b151affdd0 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -54,9 +54,6 @@ 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()) @@ -65,6 +62,11 @@ class CommandBase(object): # Handle missing/default items self.config.setdefault("tools", {}) + self.config["tools"].setdefault("cache-dir", + path.join(context.topdir, ".servo")) + # Allow "~" in cache-dir + context.sharedir = path.expanduser(self.config["tools"]["cache-dir"]) + self.config["tools"].setdefault("system-rust", False) self.config["tools"].setdefault("system-cargo", False) self.config["tools"].setdefault("rust-root", "") diff --git a/servobuild.example b/servobuild.example index db3aba17f4f..f35fc1b5da8 100644 --- a/servobuild.example +++ b/servobuild.example @@ -1,5 +1,8 @@ # Tool options [tools] +# Where Rust compiler snapshots and other downloads will be stored. Can be +# shared by multiple Servo reposities. Defaults to <servo-repo>/.servo +cache-dir = "~/.servo" # If system-rust is true, will use rustc/rustdoc from the path, or if # rust-root is specified, will make sure that rust-root is in the path # when building. Similarly for Cargo. This takes care of PATH as well as |