summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGökçen Nurlu <gnurlu1@bloomberg.net>2018-10-26 10:48:39 +0100
committerGökçen Nurlu <gnurlu1@bloomberg.net>2018-11-22 18:20:00 +0000
commite00c5bc1b9f7c58b027536fb8f96ca9edc5ef70d (patch)
tree48ad2c267a17ba9523dbff620d7bccbe22d52436
parent834dc160130c3c0399d278ff73511915f843d13c (diff)
downloadbuildstream-e00c5bc1b9f7c58b027536fb8f96ca9edc5ef70d.tar.gz
Add no-fetch flag for 'bst checkout' command
-rw-r--r--buildstream/_frontend/cli.py7
-rw-r--r--buildstream/_stream.py6
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)