mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
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>
This commit is contained in:
parent
e6503a7f38
commit
bc2403dcdb
|
@ -15,7 +15,6 @@ import re
|
||||||
import configparser
|
import configparser
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
workspace = {}
|
|
||||||
config = None
|
config = None
|
||||||
context = None
|
context = None
|
||||||
|
|
||||||
|
@ -87,7 +86,6 @@ class Context:
|
||||||
|
|
||||||
|
|
||||||
def read_workspace(basepath):
|
def read_workspace(basepath):
|
||||||
global workspace
|
|
||||||
workspace = {}
|
workspace = {}
|
||||||
if not os.path.exists(os.path.join(config.workspace_path, 'conf', 'layer.conf')):
|
if not os.path.exists(os.path.join(config.workspace_path, 'conf', 'layer.conf')):
|
||||||
if context.fixed_setup:
|
if context.fixed_setup:
|
||||||
|
@ -132,6 +130,8 @@ def read_workspace(basepath):
|
||||||
logger.debug('Found recipe %s' % pnvalues)
|
logger.debug('Found recipe %s' % pnvalues)
|
||||||
workspace[pn] = pnvalues
|
workspace[pn] = pnvalues
|
||||||
|
|
||||||
|
return workspace
|
||||||
|
|
||||||
def create_workspace(args, config, basepath, workspace):
|
def create_workspace(args, config, basepath, workspace):
|
||||||
if args.layerpath:
|
if args.layerpath:
|
||||||
workspacedir = os.path.abspath(args.layerpath)
|
workspacedir = os.path.abspath(args.layerpath)
|
||||||
|
@ -330,9 +330,9 @@ def main():
|
||||||
args = parser.parse_args(unparsed_args, namespace=global_args)
|
args = parser.parse_args(unparsed_args, namespace=global_args)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
workspace = {}
|
||||||
if not getattr(args, 'no_workspace', False):
|
if not getattr(args, 'no_workspace', False):
|
||||||
read_workspace(basepath)
|
workspace = read_workspace(basepath)
|
||||||
|
|
||||||
ret = args.func(args, config, basepath, workspace)
|
ret = args.func(args, config, basepath, workspace)
|
||||||
except DevtoolError as err:
|
except DevtoolError as err:
|
||||||
if str(err):
|
if str(err):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user