提交 47312d2c 编写于 作者: M Michal Marek 提交者: Sam Ravnborg

kbuild: simplify argument loop in scripts/config

Signed-off-by: NMichal Marek <mmarek@suse.cz>
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
上级 56643222
...@@ -62,8 +62,7 @@ if [ "$1" = "--file" ]; then ...@@ -62,8 +62,7 @@ if [ "$1" = "--file" ]; then
if [ "$FN" = "" ] ; then if [ "$FN" = "" ] ; then
usage usage
fi fi
shift shift 2
shift
else else
FN=.config FN=.config
fi fi
...@@ -76,26 +75,34 @@ while [ "$1" != "" ] ; do ...@@ -76,26 +75,34 @@ while [ "$1" != "" ] ; do
CMD="$1" CMD="$1"
shift shift
case "$CMD" in case "$CMD" in
--enable|-e) --refresh)
;;
--*-after)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
shift 2
;;
--*)
checkarg "$1" checkarg "$1"
set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
shift shift
;; ;;
esac
case "$CMD" in
--enable|-e)
set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
;;
--disable|-d) --disable|-d)
checkarg "$1"
set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set" set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set"
shift
;; ;;
--module|-m) --module|-m)
checkarg "$1"
set_var "CONFIG_$ARG" "CONFIG_$ARG=m" set_var "CONFIG_$ARG" "CONFIG_$ARG=m"
shift
;; ;;
--state|-s) --state|-s)
checkarg "$1"
if grep -q "# CONFIG_$ARG is not set" $FN ; then if grep -q "# CONFIG_$ARG is not set" $FN ; then
echo n echo n
else else
...@@ -108,37 +115,18 @@ while [ "$1" != "" ] ; do ...@@ -108,37 +115,18 @@ while [ "$1" != "" ] ; do
echo "$V" echo "$V"
fi fi
fi fi
shift
;; ;;
--enable-after|-E) --enable-after|-E)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A" set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A"
shift
shift
;; ;;
--disable-after|-D) --disable-after|-D)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A" set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A"
shift
shift
;; ;;
--module-after|-M) --module-after|-M)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A" set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A"
shift
shift
;; ;;
# undocumented because it ignores --file (fixme) # undocumented because it ignores --file (fixme)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册