summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2017-10-24 16:47:35 +0100
committerTristan Maat <tristan.maat@codethink.co.uk>2017-12-07 14:09:15 +0000
commit75133339fa327529e10d16dc3191d9eaa4209651 (patch)
tree49def8a9be6015d493aad088a1594b8329871eb7
parent4580e2e57e27511366dcd6d6cb10a9b64cf437b2 (diff)
downloadbuildstream-75133339fa327529e10d16dc3191d9eaa4209651.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 d694d8cf6..8c4753913 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 bd8fbb294..08684d4c1 100644
--- a/buildstream/_pipeline.py
+++ b/buildstream/_pipeline.py
@@ -437,7 +437,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