From e2e0e4adeefc2ccb8871ec4d62524669325ec753 Mon Sep 17 00:00:00 2001 From: SummerGift Date: Wed, 30 Oct 2019 14:01:15 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E4=B8=8D?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=9D=9E=E8=BD=AF=E4=BB=B6=E5=8C=85=20=5FPAT?= =?UTF-8?q?H=20=E5=92=8C=20=5FVER=20=E5=90=8E=E7=BC=80=E7=9A=84=E9=80=89?= =?UTF-8?q?=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmds/cmd_menuconfig.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/cmds/cmd_menuconfig.py b/cmds/cmd_menuconfig.py index 1b734119..222fb803 100644 --- a/cmds/cmd_menuconfig.py +++ b/cmds/cmd_menuconfig.py @@ -22,18 +22,24 @@ # Date Author Notes # 2018-05-28 SummerGift Add copyright information # 2019-01-07 SummerGift The prompt supports utf-8 encoding +# 2019-10-30 SummerGift fix bug when generate some config item # import os import platform from vars import Import, Export -'''menuconfig for system configuration''' - -# make rtconfig.h from .config +# judge if it's CONFIG_PKG_XX_PATH or CONFIG_PKG_XX_VER +def is_pkg_special_config(config_str): + if type(config_str) == type('a'): + if config_str.startswith("PKG_") and (config_str.endswith('_PATH') or config_str.endswith('_VER')): + return True + return False def mk_rtconfig(filename): + """make rtconfig.h from .config.""" + try: config = file(filename) except: @@ -76,8 +82,7 @@ def mk_rtconfig(filename): if setting[0].startswith('CONFIG_'): setting[0] = setting[0][7:] - # remove CONFIG_PKG_XX_PATH or CONFIG_PKG_XX_VER - if type(setting[0]) == type('a') and (setting[0].endswith('_PATH') or setting[0].endswith('_VER')): + if is_pkg_special_config(setting[0]): continue if setting[1] == 'y': @@ -92,8 +97,7 @@ def mk_rtconfig(filename): if setting[0].startswith('CONFIG_'): setting[0] = setting[0][7:] - # remove CONFIG_PKG_XX_PATH or CONFIG_PKG_XX_VER - if type(setting[0]) == type('a') and (setting[0].endswith('_PATH') or setting[0].endswith('_VER')): + if is_pkg_special_config(setting[0]): continue rtconfig.write('#define %s %s\n' % (setting[0], alt_data))