From 341c3fd6e83c956012ac734c983ad52ee46fbf96 Mon Sep 17 00:00:00 2001 From: Benjamin Schubert Date: Mon, 12 Nov 2018 09:37:17 +0000 Subject: Refactor and simplify _prepare_sandbox for elements 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 --- buildstream/_frontend/cli.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'buildstream/_frontend/cli.py') 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) -- cgit v1.2.1