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 10:34:00 +0000
commit9f0cb743cf459deb9f83574272ced2c4d4d4fa37 (patch)
tree21b764a2950ed5e7a238b1bbfeed2d5e9f8fde41 /buildstream/_frontend/cli.py
parent78e7e1c3e14e7ab291f7172cfbee12d630468fc2 (diff)
downloadbuildstream-bschubert/bst-checkout-build.tar.gz
Refactor and simplify _prepare_sandbox for elementsbschubert/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)