summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/widget.py
diff options
context:
space:
mode:
authorPhillip Smyth <phillipsmyth@Nexus-x240.dyn.ducie.codethink.co.uk>2018-06-18 14:34:39 +0100
committerknownexus <phillip.smyth@codethink.co.uk>2018-08-10 11:17:47 +0100
commitdb0478abc83afb96dc1c146668ad1e8eb7fa671f (patch)
tree7ecdf379cca9a6bb94cfa280424658aa16612c11 /buildstream/_frontend/widget.py
parenta602365c263489ae6eda71d47f63587f5e1ad4d1 (diff)
downloadbuildstream-relative_workspaces.tar.gz
Implementing relative workspacesrelative_workspaces
This fixes #191 A note has been added to NEWS explaining backwards compatibility issues
Diffstat (limited to 'buildstream/_frontend/widget.py')
-rw-r--r--buildstream/_frontend/widget.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/buildstream/_frontend/widget.py b/buildstream/_frontend/widget.py
index 3abc31d40..478f0ff14 100644
--- a/buildstream/_frontend/widget.py
+++ b/buildstream/_frontend/widget.py
@@ -418,7 +418,9 @@ class LogLine(Widget):
if "%{workspace-dirs" in format_:
workspace = element._get_workspace()
if workspace is not None:
- path = workspace.path.replace(os.getenv('HOME', '/root'), '~')
+ path = workspace.get_absolute_path()
+ if path.startswith("~/"):
+ path = os.path.join(os.getenv('HOME', '/root'), path[2:])
line = p.fmt_subst(line, 'workspace-dirs', "Workspace: {}".format(path))
else:
line = p.fmt_subst(