From: Yann E. MORIN Date: Thu, 7 Jun 2012 23:48:57 +0000 (+0200) Subject: scripts/config: add option to undef a symbol X-Git-Tag: upstream/snapshot3+hdmi~6924^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d5bfb6b3814b2c9cd83e9395a60fc4b4e42a242d;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git scripts/config: add option to undef a symbol 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" Signed-off-by: Michal Marek --- diff --git a/scripts/config b/scripts/config index 9723c7d..f65a44a 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 @@ -73,6 +74,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 @@ -134,6 +141,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