浏览代码

utils/checkpackagelib: CommentsMenusPackagesOrder: fix 'menuconfig' handling

The CommentsMenusPackagesOrder check builds the 'state' to track the
depth of menus and conditions. However, a menuconfig doesn't create a
menu by itself - it is always followed by a condition that implies the
menu. As a result, when unwinding the 'state', the level will be wrong.

Fix this by checking for menu followed by a space, so it no longer
matches menuconfig. For consistency, do the same for comment and if
as well.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Jerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Arnout Vandecappelle (Essensium/Mind) 6 年之前
父节点
当前提交
c62a282920
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      utils/checkpackagelib/lib_config.py

+ 2 - 2
utils/checkpackagelib/lib_config.py

@@ -77,8 +77,8 @@ class CommentsMenusPackagesOrder(_CheckFunction):
                                  "package/Config.in.host"]:
                                  "package/Config.in.host"]:
             return
             return
 
 
-        if text.startswith("comment") or text.startswith("if") or \
-           text.startswith("menu"):
+        if text.startswith("comment ") or text.startswith("if ") or \
+           text.startswith("menu "):
 
 
             if text.startswith("comment"):
             if text.startswith("comment"):
                 if not self.state.endswith("-comment"):
                 if not self.state.endswith("-comment"):