From 64d5db2f89b4f3712b55127215ae02ce50dd747a Mon Sep 17 00:00:00 2001 From: Jamin Lin Date: Wed, 3 Jan 2024 18:13:44 +0800 Subject: devtool: modify: fix exception Root Cause: initial_revs is an empty dictionary and do not have "." key. Traceback (most recent call last): File "scripts/devtool", line 349, in ret = main() File "scripts/devtool", line 336, in main ret = args.func(args, config, basepath, workspace) File "scripts/lib/devtool/standard.py", line 922, in modify if not initial_revs["."]: KeyError: '.' Solution: check key exists, then get its value. (From OE-Core rev: fb0db5c48abb4d56233a175fdd349d18b972e452) Signed-off-by: Jamin Lin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- scripts/lib/devtool/standard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/lib/devtool/standard.py') diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 559fd45676..2e56cd3050 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -921,7 +921,7 @@ def modify(args, config, basepath, workspace): if line.startswith('*'): (stdout, _) = bb.process.run('git rev-parse devtool-base', cwd=srctree) initial_revs["."] = stdout.rstrip() - if not initial_revs["."]: + if "." not in initial_revs: # Otherwise, just grab the head revision (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) initial_revs["."] = stdout.rstrip() -- cgit v1.2.3-54-g00ecf