summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-06 18:22:42 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2018-03-06 18:28:26 +0900
commitc0be9295404815aae1418ee437b7c8dd28b2d97d (patch)
tree39541c261ff786c133db2989640d14c83cfa5dd3
parent06ac03d4d4330fed7d0dfa75c918dcf2e285bb03 (diff)
downloadbuildstream-c0be9295404815aae1418ee437b7c8dd28b2d97d.tar.gz
_project.py: Support host environment expansion in `host-files` paths
This allows one to mount paths based on host specific environment variables, this can be useful for mounting things under XDG_RUNTIME_DIR, which is needed for host pulseaudio connections. This is another part of addressing #223
-rw-r--r--buildstream/_project.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/buildstream/_project.py b/buildstream/_project.py
index bf1353730..360bf7faa 100644
--- a/buildstream/_project.py
+++ b/buildstream/_project.py
@@ -54,6 +54,11 @@ class HostMount():
def __init__(self, path, host_path=None, optional=False):
+ # Support environment variable expansion in host mounts
+ path = os.path.expandvars(path)
+ if host_path is not None:
+ host_path = os.path.expandvars(host_path)
+
self.path = path # Path inside the sandbox
self.host_path = host_path # Path on the host
self.optional = optional # Optional mounts do not incur warnings or errors