summaryrefslogtreecommitdiff
path: root/buildstream/_frontend/cli.py
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2018-11-12 09:37:17 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2018-11-12 11:10:21 +0000
commit341c3fd6e83c956012ac734c983ad52ee46fbf96 (patch)
tree4e74133803df08dc1b3e32d0c37d78add141ba1e /buildstream/_frontend/cli.py
parenta235d443ade6bbf64a9f84e27cbac8fc68478606 (diff)
downloadbuildstream-chandan/bst-checkout-build.tar.gz
Refactor and simplify _prepare_sandbox for elementschandan/bst-checkout-build
Before we would have a intricate logics with multiple arguments that might get ignored. This simplifies the design and introduces a bool `shell` instead of having two different variables concerned about scope
Diffstat (limited to 'buildstream/_frontend/cli.py')
-rw-r--r--buildstream/_frontend/cli.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/buildstream/_frontend/cli.py b/buildstream/_frontend/cli.py
index 97feb2d87..2145c8672 100644
--- a/buildstream/_frontend/cli.py
+++ b/buildstream/_frontend/cli.py
@@ -647,16 +647,24 @@ def shell(app, element, sysroot, mount, isolate, build_, command):
def checkout(app, element, location, force, deps, integrate, hardlinks, tar):
"""Checkout a built artifact to the specified location
"""
+ from ..element import Scope
if hardlinks and tar:
click.echo("ERROR: options --hardlinks and --tar conflict", err=True)
sys.exit(-1)
+ if deps == "run":
+ scope = Scope.RUN
+ elif deps == "build":
+ scope = Scope.BUILD
+ elif deps == "none":
+ scope = Scope.NONE
+
with app.initialized():
app.stream.checkout(element,
location=location,
force=force,
- deps=deps,
+ scope=scope,
integrate=integrate,
hardlinks=hardlinks,
tar=tar)