diff options
author | Chris Laplante <chris.laplante@agilent.com> | 2025-01-12 09:53:54 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-01-20 13:38:59 +0000 |
commit | bc2403dcdbeaef0abc52d0c24a9f3e849fd34ab8 (patch) | |
tree | cfd3718a4447213e19f02ef0dd994535d5b7f9ca /scripts/devtool | |
parent | e6503a7f38ab064649eeb50bbfeac943446ec2ad (diff) | |
download | poky-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-x | scripts/devtool | 8 |
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 | |||
15 | import configparser | 15 | import configparser |
16 | import logging | 16 | import logging |
17 | 17 | ||
18 | workspace = {} | ||
19 | config = None | 18 | config = None |
20 | context = None | 19 | context = None |
21 | 20 | ||
@@ -87,7 +86,6 @@ class Context: | |||
87 | 86 | ||
88 | 87 | ||
89 | def read_workspace(basepath): | 88 | def 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 | |||
135 | def create_workspace(args, config, basepath, workspace): | 135 | def 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): |