Skip to contentSkip to conversation

scripts: config_whitelist: Handle lines with leading spaces/tabs

PATCH In review Bin Meng 2 participants 2 messages Jun 29, 2017

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH 1/1 scripts: config_whitelist: Handle lines with leading spaces/tabs

Some Kconfig options are defined in a line with leading spaces/tabs. Update build-whitelist/check-config scripts to handle such cases. Generate a new config_whitelist.txt with new scripts.

---

 scripts/build-whitelist.sh   |   4 +-
 scripts/check-config.sh      |   5 +-
 scripts/config_whitelist.txt | 115 -------------------------------------------
 3 files changed, 5 insertions(+), 119 deletions(-)
scripts/build-whitelist.sh +2 -2
index f169eaa..7d8160d 100755
@@ -39,8 +39,8 @@ git grep CONFIG_ | \
 # Finally, we need a list of the valid Kconfig options to exclude these from
 # the whitelist.
 cat `find . -name "Kconfig*"` |sed -n \
-	-e 's/^config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
-	-e 's/^menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
+	-e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
+	-e 's/^\s*menuconfig *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
 	|sort |uniq >scripts/config_whitelist.txt.tmp2
 
 # Use only the options that are present in the first file but not the second.
scripts/check-config.sh +3 -2
index 97e52dc..2677584 100755
@@ -33,8 +33,9 @@ cat ${path} |sed -n 's/^#define \(CONFIG_[A-Za-z0-9_]*\).*/\1/p' |sort |uniq \
 comm -23 ${configs} ${whitelist} > ${suspects}
 
 cat `find ${srctree} -name "Kconfig*"` |sed -n \
-	-e 's/^config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
-	-e 's/^menuconfig \([A-Za-z0-9_]*\).*$/CONFIG_\1/p' |sort |uniq > ${ok}
+	-e 's/^\s*config *\([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
+	-e 's/^\s*menuconfig \([A-Za-z0-9_]*\).*$/CONFIG_\1/p' \
+	|sort |uniq > ${ok}
 comm -23 ${suspects} ${ok} >${new_adhoc}
 if [ -s ${new_adhoc} ]; then
 	echo >&2 "Error: You must add new CONFIG options using Kconfig"
scripts/config_whitelist.txt +0 -115

518 lines not on this page · raw message

Signature · 1 line
2.9.2
#1 lore raw
Quoted 5 lines · Bin Meng

Some Kconfig options are defined in a line with leading spaces/tabs. Update build-whitelist/check-config scripts to handle such cases. Generate a new config_whitelist.txt with new scripts.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170629/b344645e/attachment.sig>