This is an automated email from the ASF dual-hosted git repository. tvb pushed a commit to branch gokcen/add_no_fetch_flag in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 633911efc36768c5587855157171b0aff6385bbd Author: Gökçen Nurlu <[email protected]> AuthorDate: Mon Oct 29 11:37:46 2018 +0000 Add no-fetch flag for 'bst source-bundle' --- buildstream/_frontend/cli.py | 7 +++++-- buildstream/_stream.py | 14 +++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py index 5d083ee..d733890 100644 --- a/buildstream/_frontend/cli.py +++ b/buildstream/_frontend/cli.py @@ -849,9 +849,11 @@ def workspace_list(app): help="The directory to write the tarball to") @click.argument('element', type=click.Path(readable=False)) [email protected]('--no-fetch', 'no_fetch', default=False, is_flag=True, + help="Disable auto-fetching of junction(s)") @click.pass_obj def source_bundle(app, element, force, directory, - track_, compression, except_): + track_, compression, except_, no_fetch): """Produce a source bundle to be manually executed """ with app.initialized(): @@ -859,4 +861,5 @@ def source_bundle(app, element, force, directory, track_first=track_, force=force, compression=compression, - except_targets=except_) + except_targets=except_, + no_fetch=no_fetch) diff --git a/buildstream/_stream.py b/buildstream/_stream.py index 2e88d5a..bf0e66f 100644 --- a/buildstream/_stream.py +++ b/buildstream/_stream.py @@ -729,12 +729,15 @@ class Stream(): # track_first (bool): Track new source references before bundling # compression (str): The compression type to use # force (bool): Overwrite an existing tarball + # no_fetch (bool): Flag to disable auto-fetch of `target` and junction(s) + # needed by `target` # def source_bundle(self, target, directory, *, track_first=False, force=False, compression="gz", - except_targets=()): + except_targets=(), + no_fetch): if track_first: track_targets = (target,) @@ -745,7 +748,7 @@ class Stream(): selection=PipelineSelection.ALL, except_targets=except_targets, track_selection=PipelineSelection.ALL, - fetch_subprojects=True) + fetch_subprojects=not no_fetch) # source-bundle only supports one target target = self.targets[0] @@ -770,7 +773,12 @@ class Stream(): # Fetch and possibly track first # - self._fetch(elements, track_elements=track_elements) + if not no_fetch: + self._fetch(elements, track_elements=track_elements) + else: + # No fetch, just tracking + self._fetch([], track_elements=track_elements) + self._pipeline.assert_sources_cached(elements) # We don't use the scheduler for this as it is almost entirely IO # bound.
