summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-01-22 06:40:47 +0100
committerJürg Billeter <j@bitron.ch>2019-01-22 08:08:18 +0100
commit91b7c36b246b5eb0acf0f1d99612af2380d0f5cd (patch)
treede338a3d0e69c413f10a0f1453a1313034e8cc12
parent70b11ec3d93c5b10893c289c78b12c4aed31f2fd (diff)
downloadbuildstream-91b7c36b246b5eb0acf0f1d99612af2380d0f5cd.tar.gz
_frontend/cli.py: Ignore junctions in default targets where appropriate
Junctions cannot be built, pulled, or pushed. Specifying a junction on the command line for these commands will result in an error. However, junctions may be in the list of default targets, so they need to be ignored for build, pull, and push commands.
-rw-r--r--buildstream/_frontend/cli.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 6674b14a6..d6e1a2dda 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -361,8 +361,12 @@ def build(app, elements, all_, track_, track_save, track_all, track_except, trac
click.echo("WARNING: --track-save is deprecated, saving is now unconditional", err=True)
with app.initialized(session_name="Build"):
+ ignore_junction_targets = False
+
if not elements:
elements = app.project.get_default_targets()
+ # Junction elements cannot be built, exclude them from default targets
+ ignore_junction_targets = True
if track_all:
track_ = elements
@@ -371,6 +375,7 @@ def build(app, elements, all_, track_, track_save, track_all, track_except, trac
track_targets=track_,
track_except=track_except,
track_cross_junctions=track_cross_junctions,
+ ignore_junction_targets=ignore_junction_targets,
build_all=all_)
@@ -408,10 +413,15 @@ def pull(app, elements, deps, remote):
"""
with app.initialized(session_name="Pull"):
+ ignore_junction_targets = False
+
if not elements:
elements = app.project.get_default_targets()
+ # Junction elements cannot be pulled, exclude them from default targets
+ ignore_junction_targets = True
- app.stream.pull(elements, selection=deps, remote=remote)
+ app.stream.pull(elements, selection=deps, remote=remote,
+ ignore_junction_targets=ignore_junction_targets)
##################################################################
@@ -450,10 +460,15 @@ def push(app, elements, deps, remote):
all: All dependencies
"""
with app.initialized(session_name="Push"):
+ ignore_junction_targets = False
+
if not elements:
elements = app.project.get_default_targets()
+ # Junction elements cannot be pushed, exclude them from default targets
+ ignore_junction_targets = True
- app.stream.push(elements, selection=deps, remote=remote)
+ app.stream.push(elements, selection=deps, remote=remote,
+ ignore_junction_targets=ignore_junction_targets)
##################################################################