utils/checkpackagelib: CommentsMenusPackagesOrder: get value of variable 'level'
authorJerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
Tue, 3 Sep 2019 21:13:26 +0000 (23:13 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Wed, 25 Sep 2019 20:24:42 +0000 (22:24 +0200)
Get value of variable 'level' only just after the state change.

Signed-off-by: Jerzy Grzegorek <jerzy.m.grzegorek@gmail.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
utils/checkpackagelib/lib_config.py

index 8f7b13a866e2d1de78d23f94ed09e77b63fa01e7..d12653f080a70aac0ee4f5f283ca7ddb77775497 100644 (file)
@@ -115,8 +115,9 @@ class CommentsMenusPackagesOrder(_CheckFunction):
             elif text.startswith("endmenu"):
                 self.state = self.state[:-5]
 
-        elif source_line:
             self.level = self.get_level()
+
+        elif source_line:
             new_package = source_line.group(1)
 
             # We order _ before A, so replace it with .