summaryrefslogtreecommitdiffstats
path: root/scripts/devtool
diff options
context:
space:
mode:
authorChris Laplante <chris.laplante@agilent.com>2025-01-12 09:53:54 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-20 13:38:59 +0000
commitbc2403dcdbeaef0abc52d0c24a9f3e849fd34ab8 (patch)
treecfd3718a4447213e19f02ef0dd994535d5b7f9ca /scripts/devtool
parente6503a7f38ab064649eeb50bbfeac943446ec2ad (diff)
downloadpoky-bc2403dcdbeaef0abc52d0c24a9f3e849fd34ab8.tar.gz
devtool: un-globalize 'workspace' variable
(From OE-Core rev: 3d32e507588fc292bf0f656b26817aee407f2d7c) Signed-off-by: Chris Laplante <chris.laplante@agilent.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/devtool')
-rwxr-xr-xscripts/devtool8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/devtool b/scripts/devtool
index acc4e0e982..d7a5903c9f 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -15,7 +15,6 @@ import re
15import configparser 15import configparser
16import logging 16import logging
17 17
18workspace = {}
19config = None 18config = None
20context = None 19context = None
21 20
@@ -87,7 +86,6 @@ class Context:
87 86
88 87
89def read_workspace(basepath): 88def read_workspace(basepath):
90 global workspace
91 workspace = {} 89 workspace = {}
92 if not os.path.exists(os.path.join(config.workspace_path, 'conf', 'layer.conf')): 90 if not os.path.exists(os.path.join(config.workspace_path, 'conf', 'layer.conf')):
93 if context.fixed_setup: 91 if context.fixed_setup:
@@ -132,6 +130,8 @@ def read_workspace(basepath):
132 logger.debug('Found recipe %s' % pnvalues) 130 logger.debug('Found recipe %s' % pnvalues)
133 workspace[pn] = pnvalues 131 workspace[pn] = pnvalues
134 132
133 return workspace
134
135def create_workspace(args, config, basepath, workspace): 135def create_workspace(args, config, basepath, workspace):
136 if args.layerpath: 136 if args.layerpath:
137 workspacedir = os.path.abspath(args.layerpath) 137 workspacedir = os.path.abspath(args.layerpath)
@@ -330,9 +330,9 @@ def main():
330 args = parser.parse_args(unparsed_args, namespace=global_args) 330 args = parser.parse_args(unparsed_args, namespace=global_args)
331 331
332 try: 332 try:
333 workspace = {}
333 if not getattr(args, 'no_workspace', False): 334 if not getattr(args, 'no_workspace', False):
334 read_workspace(basepath) 335 workspace = read_workspace(basepath)
335
336 ret = args.func(args, config, basepath, workspace) 336 ret = args.func(args, config, basepath, workspace)
337 except DevtoolError as err: 337 except DevtoolError as err:
338 if str(err): 338 if str(err):