summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRoland Hieber <rhi@pengutronix.de>2022-07-24 01:51:19 +0200
committerSteve Sakoman <steve@sakoman.com>2022-08-17 04:55:49 -1000
commit3aee3425956020166d99ec085e35e21b3daf625f (patch)
tree55910cecc7aca68618ae4e9505e81507be35d04f /scripts
parent27e4c6f98be296fb5f67ac7775461854d48f6c9a (diff)
downloadopenembedded-core-contrib-3aee3425956020166d99ec085e35e21b3daf625f.tar.gz
devtool: error out when workspace is using old override syntax
When the workspace bbappends are still using the old override syntax with EXTERNALSRC_pn-*, externalsrc_re will not match, and pn will never be assigned, leading to a nondescript UnboundLocalError being raised on the user's terminal. Try to detect that situation and give the user a hint how to solve it. Signed-off-by: Roland Hieber <rhi@pengutronix.de> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit d42ea8e849cf2df3708406418b961168268b316a) Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/devtool10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/devtool b/scripts/devtool
index af4811b922..20d785c7f7 100755
--- a/scripts/devtool
+++ b/scripts/devtool
@@ -104,6 +104,7 @@ def read_workspace():
for fn in glob.glob(os.path.join(config.workspace_path, 'appends', '*.bbappend')):
with open(fn, 'r') as f:
pnvalues = {}
+ pn = None
for line in f:
res = externalsrc_re.match(line.rstrip())
if res:
@@ -123,6 +124,9 @@ def read_workspace():
elif line.startswith('# srctreebase: '):
pnvalues['srctreebase'] = line.split(':', 1)[1].strip()
if pnvalues:
+ if not pn:
+ raise DevtoolError("Found *.bbappend in %s, but could not determine EXTERNALSRC:pn-*. "
+ "Maybe still using old syntax?" % config.workspace_path)
if not pnvalues.get('srctreebase', None):
pnvalues['srctreebase'] = pnvalues['srctree']
logger.debug('Found recipe %s' % pnvalues)
@@ -314,10 +318,10 @@ def main():
args = parser.parse_args(unparsed_args, namespace=global_args)
- if not getattr(args, 'no_workspace', False):
- read_workspace()
-
try:
+ if not getattr(args, 'no_workspace', False):
+ read_workspace()
+
ret = args.func(args, config, basepath, workspace)
except DevtoolError as err:
if str(err):