]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
devtool: un-globalize 'workspace' variable
authorChris Laplante <chris.laplante@agilent.com>
Sun, 12 Jan 2025 14:53:54 +0000 (09:53 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Jan 2025 13:38:56 +0000 (13:38 +0000)
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>
scripts/devtool

index acc4e0e9820da785c1aeb37af773e6b6567db2cd..d7a5903c9fb9090fa394da472544d8ddd54fc56b 100755 (executable)
@@ -15,7 +15,6 @@ import re
 import configparser
 import logging
 
-workspace = {}
 config = None
 context = None
 
@@ -87,7 +86,6 @@ class Context:
 
 
 def read_workspace(basepath):
-    global workspace
     workspace = {}
     if not os.path.exists(os.path.join(config.workspace_path, 'conf', 'layer.conf')):
         if context.fixed_setup:
@@ -132,6 +130,8 @@ def read_workspace(basepath):
                 logger.debug('Found recipe %s' % pnvalues)
                 workspace[pn] = pnvalues
 
+    return workspace
+
 def create_workspace(args, config, basepath, workspace):
     if args.layerpath:
         workspacedir = os.path.abspath(args.layerpath)
@@ -330,9 +330,9 @@ def main():
     args = parser.parse_args(unparsed_args, namespace=global_args)
 
     try:
+        workspace = {}
         if not getattr(args, 'no_workspace', False):
-            read_workspace(basepath)
-
+            workspace = read_workspace(basepath)
         ret = args.func(args, config, basepath, workspace)
     except DevtoolError as err:
         if str(err):