From 0b36bba5570d4f541b2470578096070b19e3058e Mon Sep 17 00:00:00 2001 From: Tristan Maat Date: Tue, 24 Oct 2017 16:47:35 +0100 Subject: Add `bst build --track-except` --- buildstream/_frontend/main.py | 10 +++++++--- buildstream/_pipeline.py | 2 +- 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 -- cgit v1.2.1