... |
... |
@@ -462,8 +462,9 @@ class Stream(): |
462
|
462
|
track_selection=PipelineSelection.REDIRECT)
|
463
|
463
|
|
464
|
464
|
for target, directory in zip(elements, directories):
|
465
|
|
- directory = os.path.abspath(directory)
|
466
|
|
-
|
|
465
|
+ if not os.path.isabs(directory):
|
|
466
|
+ directory = os.path.abspath(os.path.join(self._context.workspacedir, directory))
|
|
467
|
+
|
467
|
468
|
if not list(target.sources()):
|
468
|
469
|
build_depends = [x.name for x in target.dependencies(Scope.BUILD, recurse=False)]
|
469
|
470
|
if not build_depends:
|
... |
... |
@@ -478,7 +479,7 @@ class Stream(): |
478
|
479
|
workspace = workspaces.get_workspace(target._get_full_name())
|
479
|
480
|
if workspace and not force:
|
480
|
481
|
raise StreamError("Workspace '{}' is already defined at: {}"
|
481
|
|
- .format(target.name, workspace.get_absolute_path()))
|
|
482
|
+ .format(target.name, workspace.get_absolute_path()))
|
482
|
483
|
|
483
|
484
|
# If we're going to checkout, we need at least a fetch,
|
484
|
485
|
# if we were asked to track first, we're going to fetch anyway.
|
... |
... |
@@ -502,6 +503,7 @@ class Stream(): |
502
|
503
|
try:
|
503
|
504
|
os.makedirs(directory, exist_ok=True)
|
504
|
505
|
except OSError as e:
|
|
506
|
+ # should we try to make this more attomic?
|
505
|
507
|
raise StreamError("Failed to create workspace directory: {}".format(e)) from e
|
506
|
508
|
|
507
|
509
|
workspaces.create_workspace(target._get_full_name(), directory)
|
... |
... |
@@ -510,7 +512,6 @@ class Stream(): |
510
|
512
|
with target.timed_activity("Staging sources to {}".format(directory)):
|
511
|
513
|
target._open_workspace()
|
512
|
514
|
|
513
|
|
- ## should we try to make this more attomic?
|
514
|
515
|
workspaces.save_config()
|
515
|
516
|
self._message(MessageType.INFO, "Saved workspace configuration")
|
516
|
517
|
|