From: Jerzy Grzegorek Date: Sat, 5 Oct 2019 12:22:15 +0000 (+0200) Subject: utils/checkpackagelib: CommentsMenusPackagesOrder: remove '-comment' state before... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd251d68e5995b7c146c9712ce25a187a25b87de;p=buildroot.git utils/checkpackagelib: CommentsMenusPackagesOrder: remove '-comment' state before the '-menu' one A comment is considered an alternative delimiter like a menu. I.e., a menu that comes after a comment should not be considered a submenu of that comment. Therefore, remove the '-comment' state before adding the '-menu' one. Signed-off-by: Jerzy Grzegorek Cc: Ricardo Martincoski Reviewed-by: Ricardo Martincoski Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- diff --git a/utils/checkpackagelib/lib_config.py b/utils/checkpackagelib/lib_config.py index fc0df3dd17..499660feb7 100644 --- a/utils/checkpackagelib/lib_config.py +++ b/utils/checkpackagelib/lib_config.py @@ -107,6 +107,9 @@ class CommentsMenusPackagesOrder(_CheckFunction): self.state += "-if" elif text.startswith("menu"): + if self.state.endswith("-comment"): + self.state = self.state[:-8] + self.state += "-menu" self.initialize_level_elements(text)