[U-Boot] [PATCH v2 1/2] build-whitelist: do not add new options to whitelist when update
Masahiro Yamada
yamada.masahiro at socionext.com
Fri Sep 23 18:00:41 CEST 2016
If somebody adds references to new CONFIG options in source files,
they will be added in the whitelist when we sync it. (For example,
if we run scripts/build-whitelist.sh against commit 201c9d884dca,
new options CONFIG_SPL_DFU_SUPPORT and CONFIG_USB_XHCI_UNIPHIER will
appear in the list.)
In order to make steady progress of Kconfig migration, we want to
only decrease options in the whitelist, but never increase.
So, when we update the whitelist, we should create a temporary list,
then take the intersection of the temporary list and the current
whitelist.
Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
---
Changes in v2:
- V1 fails to create scripts/config-whitelist.txt from scratch.
Fix it.
scripts/build-whitelist.sh | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/scripts/build-whitelist.sh b/scripts/build-whitelist.sh
index 7cf7a66..f169eaa 100755
--- a/scripts/build-whitelist.sh
+++ b/scripts/build-whitelist.sh
@@ -45,7 +45,18 @@ cat `find . -name "Kconfig*"` |sed -n \
# Use only the options that are present in the first file but not the second.
comm -23 scripts/config_whitelist.txt.tmp1 scripts/config_whitelist.txt.tmp2 \
- |sort |uniq >scripts/config_whitelist.txt
-rm scripts/config_whitelist.txt.tmp1 scripts/config_whitelist.txt.tmp2
+ |sort |uniq >scripts/config_whitelist.txt.tmp3
+
+# If scripts/config_whitelist.txt already exists, take the intersection of the
+# current list and the new one. We do not want to increase whitelist options.
+if [ -r scripts/config_whitelist.txt ]; then
+ comm -12 scripts/config_whitelist.txt.tmp3 scripts/config_whitelist.txt \
+ > scripts/config_whitelist.txt.tmp4
+ mv scripts/config_whitelist.txt.tmp4 scripts/config_whitelist.txt
+else
+ mv scripts/config_whitelist.txt.tmp3 scripts/config_whitelist.txt
+fi
+
+rm scripts/config_whitelist.txt.tmp*
unset LC_ALL LC_COLLATE
--
1.9.1
More information about the U-Boot
mailing list