diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-06 18:22:42 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-03-06 18:28:26 +0900 |
commit | c0be9295404815aae1418ee437b7c8dd28b2d97d (patch) | |
tree | 39541c261ff786c133db2989640d14c83cfa5dd3 | |
parent | 06ac03d4d4330fed7d0dfa75c918dcf2e285bb03 (diff) | |
download | buildstream-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.py | 5 |
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 |