]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool: modify: fix exception
authorJamin Lin <jamin_lin@aspeedtech.com>
Wed, 3 Jan 2024 10:13:44 +0000 (18:13 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 7 Jan 2024 12:24:54 +0000 (12:24 +0000)
Root Cause:
initial_revs is an empty dictionary and do not have "." key.

Traceback (most recent call last):
  File "scripts/devtool", line 349, in <module>
    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.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/standard.py

index 559fd45676c696aac76af23d0cc5a4cf67b88beb..2e56cd3050b53c7ee8a77fea6b01caee4c91c529 100644 (file)
@@ -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()