You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:40:37 UTC
[buildstream] 04/07: Add no-fetch flag for 'bst checkout' command
This is an automated email from the ASF dual-hosted git repository.
root pushed a commit to branch gokcen/no_auto_fetch
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit e00c5bc1b9f7c58b027536fb8f96ca9edc5ef70d
Author: Gökçen Nurlu <gn...@bloomberg.net>
AuthorDate: Fri Oct 26 10:48:39 2018 +0100
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 6657cdf..228a416 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 72e4990..2e88d5a 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)