aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jerzy Grzegorek <jerzy.m.grzegorek@gmail.com>2019-09-03 23:13:28 +0200
committerGravatar Thomas Petazzoni <thomas.petazzoni@bootlin.com>2019-09-25 22:24:42 +0200
commitc82e0092f53cbf97dc0a0bfb7db1afa023513cd3 (patch)
tree1ce5b8c797dd1ca928f25e26e095a86e96eafda7
parent7197d3cb807baefc4840dd6b636b00bbdfc5cdf5 (diff)
downloadbuildroot-c82e0092f53cbf97dc0a0bfb7db1afa023513cd3.tar.gz
buildroot-c82e0092f53cbf97dc0a0bfb7db1afa023513cd3.tar.bz2
utils/checkpackagelib: CommentsMenusPackagesOrder: change the type of variable 'new_package'
Change the type of variable 'new_package' to make it a class member. It will be used not only locally. Also initialize it. 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>
-rw-r--r--utils/checkpackagelib/lib_config.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/checkpackagelib/lib_config.py b/utils/checkpackagelib/lib_config.py
index aaa31e4d72..fc0df3dd17 100644
--- a/utils/checkpackagelib/lib_config.py
+++ b/utils/checkpackagelib/lib_config.py
@@ -68,6 +68,7 @@ class CommentsMenusPackagesOrder(_CheckFunction):
def before(self):
self.state = ""
self.level = 0
+ self.new_package = ""
def get_level(self):
return len(self.state.split('-')) - 1
@@ -123,10 +124,10 @@ class CommentsMenusPackagesOrder(_CheckFunction):
self.level = self.get_level()
elif source_line:
- new_package = source_line.group(1)
+ self.new_package = source_line.group(1)
# We order _ before A, so replace it with .
- new_package_ord = new_package.replace('_', '.')
+ new_package_ord = self.new_package.replace('_', '.')
if self.package[self.level] != "" and \
self.print_package_warning[self.level] and \
@@ -140,7 +141,7 @@ class CommentsMenusPackagesOrder(_CheckFunction):
"{spaces}first incorrect package: {package}"
.format(prefix=prefix, spaces=spaces,
menu=self.menu_of_packages[self.level],
- package=new_package),
+ package=self.new_package),
text]
self.package[self.level] = new_package_ord