From e00c5bc1b9f7c58b027536fb8f96ca9edc5ef70d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6k=C3=A7en=20Nurlu?= Date: Fri, 26 Oct 2018 10:48:39 +0100 Subject: Add no-fetch flag for 'bst checkout' command --- buildstream/_frontend/cli.py | 7 +++++-- buildstream/_stream.py | 6 ++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py index 6657cdf23..228a41648 100644 --- a/buildstream/_frontend/cli.py +++ b/buildstream/_frontend/cli.py @@ -652,8 +652,10 @@ def shell(app, element, sysroot, mount, isolate, build_, command): @click.argument('element', type=click.Path(readable=False)) @click.argument('location', type=click.Path()) +@click.option('--no-fetch', 'no_fetch', default=False, is_flag=True, + help="Disable auto-fetching of junction(s) automatically") @click.pass_obj -def checkout(app, element, location, force, deps, integrate, hardlinks, tar): +def checkout(app, element, location, force, deps, integrate, hardlinks, tar, no_fetch): """Checkout a built artifact to the specified location """ @@ -668,7 +670,8 @@ def checkout(app, element, location, force, deps, integrate, hardlinks, tar): deps=deps, integrate=integrate, hardlinks=hardlinks, - tar=tar) + tar=tar, + no_fetch=no_fetch) ################################################################## diff --git a/buildstream/_stream.py b/buildstream/_stream.py index 72e4990eb..2e88d5a59 100644 --- a/buildstream/_stream.py +++ b/buildstream/_stream.py @@ -372,6 +372,7 @@ class Stream(): # will be placed at the given location. If true and # location is '-', the tarball will be dumped on the # standard output. + # no_fetch (bool): Flag to disable auto-fetch of junctions needed by `target` # def checkout(self, target, *, location=None, @@ -379,10 +380,11 @@ class Stream(): deps='run', integrate=True, hardlinks=False, - tar=False): + tar=False, + no_fetch): # We only have one target in a checkout command - elements, _ = self._load((target,), (), fetch_subprojects=True) + elements, _ = self._load((target,), (), fetch_subprojects=not no_fetch) target = elements[0] self._check_location_writable(location, force=force, tar=tar) -- cgit v1.2.1