summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2017-10-24 16:47:35 +0100
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-12-13 12:36:41 -0500
commit0b36bba5570d4f541b2470578096070b19e3058e (patch)
tree862b4c897c8bdbb53f30eedc32ae6d4ee76a7e87
parentcee2710aef51b32c2fc824ae6971acd610cd74ae (diff)
downloadbuildstream-0b36bba5570d4f541b2470578096070b19e3058e.tar.gz
Add `bst build --track-except`
-rw-r--r--buildstream/_frontend/main.py10
-rw-r--r--buildstream/_pipeline.py2
2 files changed, 8 insertions, 4 deletions
diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py
index b25e398c7..ef908e645 100644
--- a/buildstream/_frontend/main.py
+++ b/buildstream/_frontend/main.py
@@ -100,7 +100,8 @@ def override_completions(cmd_param, ctx, args, incomplete):
(cmd_param.name == 'elements' or
cmd_param.name == 'element' or
cmd_param.name == 'except_' or
- cmd_param.opts == ['--track']):
+ cmd_param.opts == ['--track'] or
+ cmd_param.opts == ['--track-except']):
return complete_target(ctx, args, incomplete)
raise CompleteUnhandled()
@@ -198,15 +199,18 @@ def cli(context, **kwargs):
type=click.Path(dir_okay=False, readable=True),
help="Specify elements to track during the build. Can be used "
"repeatedly to specify multiple elements")
+@click.option('--track-except', multiple=True,
+ type=click.Path(dir_okay=False, readable=True),
+ help="Except certain dependencies from tracking")
@click.option('--track-save', default=False, is_flag=True,
help="Write out the tracked references to their element files")
@click.argument('elements', nargs=-1,
type=click.Path(dir_okay=False, readable=True))
@click.pass_obj
-def build(app, elements, all, track, track_save):
+def build(app, elements, all, track, track_save, track_except):
"""Build elements in a pipeline"""
- app.initialize(elements, rewritable=track_save)
+ app.initialize(elements, except_=track_except, rewritable=track_save)
app.pipeline.initialize(use_remote_cache=True, inconsistent=track)
app.print_heading()
try:
diff --git a/buildstream/_pipeline.py b/buildstream/_pipeline.py
index c1d3c1b56..550ab60a3 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -434,7 +434,7 @@ class Pipeline():
if build_all:
plan = self.dependencies(Scope.ALL)
else:
- plan = self.plan()
+ plan = self.plan(except_=False)
# We want to start the build queue with any elements that are
# not being tracked first