aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-06-28 12:18:36 -0400
committerGitHub <noreply@github.com>2019-06-28 12:18:36 -0400
commit2e9637477ca1a3da2e417f7f349ab13ff74a73a8 (patch)
treeebb029e58aebf0e8a8e63c2dd3b171fc0ebbd798 /python
parenta8f4c64021a9cbbb7cc7d2b9e75344fb8c89e1ac (diff)
parente68b4e5fad1a4632086223a72122b460ca9f795b (diff)
downloadservo-2e9637477ca1a3da2e417f7f349ab13ff74a73a8.tar.gz
servo-2e9637477ca1a3da2e417f7f349ab13ff74a73a8.zip
Auto merge of #23628 - emilio:path-shuffling-cleanup, r=Manishearth
build: Cleanup some path-munging code. I was looking at this today, and this seems better than the pre-existing code, generally pre-pending to these paths isn't great... <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23628) <!-- Reviewable:end -->
Diffstat (limited to 'python')
-rw-r--r--python/servo/command_base.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py
index d39576fe9c9..0b7ed2cf50b 100644
--- a/python/servo/command_base.py
+++ b/python/servo/command_base.py
@@ -211,7 +211,7 @@ def append_to_path_env(string, env, name):
if name in env:
variable = env[name]
if len(variable) > 0:
- variable += ":"
+ variable += os.pathsep
variable += string
env[name] = variable
@@ -641,7 +641,7 @@ install them, let us know by filing a bug!")
env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true"
if extra_path:
- env["PATH"] = "%s%s%s" % (os.pathsep.join(extra_path), os.pathsep, env["PATH"])
+ append_to_path_env(os.pathsep.join(extra_path), env, "PATH")
if self.config["build"]["incremental"]:
env["CARGO_INCREMENTAL"] = "1"
@@ -649,16 +649,8 @@ install them, let us know by filing a bug!")
env["CARGO_INCREMENTAL"] = "0"
if extra_lib:
- if sys.platform == "darwin":
- env["DYLD_LIBRARY_PATH"] = "%s%s%s" % \
- (os.pathsep.join(extra_lib),
- os.pathsep,
- env.get("DYLD_LIBRARY_PATH", ""))
- else:
- env["LD_LIBRARY_PATH"] = "%s%s%s" % \
- (os.pathsep.join(extra_lib),
- os.pathsep,
- env.get("LD_LIBRARY_PATH", ""))
+ path_var = "DYLD_LIBRARY_PATH" if sys.platform == "darwin" else "LD_LIBRARY_PATH"
+ append_to_path_env(os.pathsep.join(extra_lib), env, path_var)
# Paths to Android build tools:
if self.config["android"]["sdk"]: