utils/checkpackagelib: CommentsMenusPackagesOrder: get value of variable 'level'

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>
This commit is contained in:
Jerzy Grzegorek 2019-09-03 23:13:26 +02:00 committed by Thomas Petazzoni
parent 6748e42ace
commit 4e88b37274

View 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 .