diff options
| author | MurphyZhao <[email protected]> | 2018-12-25 14:18:50 +0800 |
|---|---|---|
| committer | MurphyZhao <[email protected]> | 2018-12-26 09:27:59 +0800 |
| commit | 2d19eafcf5bb8eec6520a94b51902b317d3c650b (patch) | |
| tree | 383633f170b58285d0da7879401d76f717db1b00 /tools/menuconfig.py | |
| parent | 2befae8873637aa27ffbb57b6cac02c2c1c48484 (diff) | |
[tools] pyconfig 增加 silent 模式,不显示窗口但可以更新 .config 和 rtconfig.h
Signed-off-by: MurphyZhao <[email protected]>
Diffstat (limited to 'tools/menuconfig.py')
| -rw-r--r-- | tools/menuconfig.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tools/menuconfig.py b/tools/menuconfig.py index ea221553d0..96846b9ff2 100644 --- a/tools/menuconfig.py +++ b/tools/menuconfig.py @@ -251,3 +251,31 @@ def pyconfig(RTT_ROOT): if mtime != mtime2: mk_rtconfig(fn) + +# pyconfig_silent for windows and linux +def pyconfig_silent(RTT_ROOT): + import pymenuconfig + print("In pyconfig silent mode. Don`t display menuconfig window.") + + touch_env() + env_dir = get_env_dir() + + os.environ['PKGS_ROOT'] = os.path.join(env_dir, 'packages') + + fn = '.config' + + if os.path.isfile(fn): + mtime = os.path.getmtime(fn) + else: + mtime = -1 + + pymenuconfig.main(['--kconfig', 'Kconfig', '--config', '.config', '--silent', 'True']) + + if os.path.isfile(fn): + mtime2 = os.path.getmtime(fn) + else: + mtime2 = -1 + + # make rtconfig.h + if mtime != mtime2: + mk_rtconfig(fn) |
