summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
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-24 14:37:28 +0100
commit2f175f0a6959aef61a064baf68cd8341390872fc (patch)
tree746edd3142a60c92c48cf2f8f8a6d031d622b172 /buildstream/_frontend/cli.py
parentee2d8434a60ca1be7329590e86cad4330de5f36f (diff)
downloadbuildstream-2f175f0a6959aef61a064baf68cd8341390872fc.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.
Diffstat (limited to 'buildstream/_frontend/cli.py')
-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 43b827f18..ab190aae4 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_)
@@ -1032,10 +1037,15 @@ def artifact_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)
##################################################################
@@ -1074,10 +1084,15 @@ def artifact_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)
################################################################