[PATCH 3/3] scripts/config: add option to undef a symbol

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It is currently possible to enable, disable or modularise
a symbol. Also, an undefined symbol is reported as such.

Add a new command to undefine a symbol, by removing the
corresponding line from the .config file.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@xxxxxxx>
---
 scripts/config |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/scripts/config b/scripts/config
index 09bd4ec..b75aea9 100755
--- a/scripts/config
+++ b/scripts/config
@@ -17,6 +17,7 @@ commands:
 	                     Set option to "string"
 	--set-val option value
 	                     Set option to value
+	--undefine|-u option Undefine option
 	--state|-s option    Print state of option (n,y,m,undef)
 
 	--enable-after|-E beforeopt option
@@ -75,6 +76,12 @@ set_var() {
 	fi
 }
 
+undef_var() {
+	local name=$1
+
+	sed -ri "/^($name=|# $name is not set)/d" "$FN"
+}
+
 if [ "$1" = "--file" ]; then
 	FN="$2"
 	if [ "$FN" = "" ] ; then
@@ -130,6 +137,9 @@ while [ "$1" != "" ] ; do
 		set_var "${CONFIG_}$ARG" "${CONFIG_}$ARG=$1"
 		shift
 		;;
+	--undefine|-u)
+		undef_var "${CONFIG_}$ARG"
+		;;
 
 	--state|-s)
 		if grep -q "# ${CONFIG_}$ARG is not set" $FN ; then
-- 
1.7.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux