Skip to content

Commit

Permalink
kbuild: simplify argument loop in scripts/config
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Marek <[email protected]>
Signed-off-by: Sam Ravnborg <[email protected]>
  • Loading branch information
michal42 authored and sravnborg committed Jun 14, 2009
1 parent 5664322 commit 47312d2
Showing 1 changed file with 16 additions and 28 deletions.
44 changes: 16 additions & 28 deletions scripts/config
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ if [ "$1" = "--file" ]; then
if [ "$FN" = "" ] ; then
usage
fi
shift
shift
shift 2
else
FN=.config
fi
Expand All @@ -76,26 +75,34 @@ while [ "$1" != "" ] ; do
CMD="$1"
shift
case "$CMD" in
--enable|-e)
--refresh)
;;
--*-after)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
shift 2
;;
--*)
checkarg "$1"
set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
shift
;;
esac
case "$CMD" in
--enable|-e)
set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
;;

--disable|-d)
checkarg "$1"
set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set"
shift
;;

--module|-m)
checkarg "$1"
set_var "CONFIG_$ARG" "CONFIG_$ARG=m"
shift
;;

--state|-s)
checkarg "$1"
if grep -q "# CONFIG_$ARG is not set" $FN ; then
echo n
else
Expand All @@ -108,37 +115,18 @@ while [ "$1" != "" ] ; do
echo "$V"
fi
fi
shift
;;

--enable-after|-E)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A"
shift
shift
;;

--disable-after|-D)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A"
shift
shift
;;

--module-after|-M)
checkarg "$1"
A=$ARG
checkarg "$2"
B=$ARG
set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A"
shift
shift
;;

# undocumented because it ignores --file (fixme)
Expand Down

0 comments on commit 47312d2

Please sign in to comment.