From e533c88760b7d2d312aacf635971862afffcafe3 Mon Sep 17 00:00:00 2001 From: Roland Dobai Date: Tue, 19 Nov 2019 15:09:27 +0100 Subject: [PATCH] tools: Write Kconfig files always Write COMPONENT_KCONFIGS_SOURCE_FILE and COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE files always even when COMPONENT_KCONFIGS or COMPONENT_KCONFIGS_PROJBUILD are empty variables because kconfiglib expects them to exist. --- tools/kconfig_new/prepare_kconfig_files.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/kconfig_new/prepare_kconfig_files.py b/tools/kconfig_new/prepare_kconfig_files.py index 913c27c9c8..360354dea0 100644 --- a/tools/kconfig_new/prepare_kconfig_files.py +++ b/tools/kconfig_new/prepare_kconfig_files.py @@ -54,7 +54,9 @@ def _prepare_source_files(env_dict): old_content = f.read() except Exception: # File doesn't exist or other issue - old_content = '' + old_content = None + # "None" ensures that it won't be equal to new_content when it is empty string because files need to be + # created for empty environment variables as well if new_content != old_content: # write or rewrite file only if it is necessary