diff options
author | Michal Marek <mmarek@suse.cz> | 2009-05-25 10:43:25 -0400 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-06-14 16:48:08 -0400 |
commit | 47312d2cfd9b769c1739738602c163c4c9814c7b (patch) | |
tree | 029e0c3ff19b5a246bae472f36b19e9281293cfd /scripts | |
parent | 566432224731c3d8fa7925ce07953701f536a666 (diff) |
kbuild: simplify argument loop in scripts/config
Signed-off-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/config | 44 |
1 files changed, 16 insertions, 28 deletions
diff --git a/scripts/config b/scripts/config index 30825a5677f..640c6fe4d64 100755 --- a/scripts/config +++ b/scripts/config | |||
@@ -62,8 +62,7 @@ if [ "$1" = "--file" ]; then | |||
62 | if [ "$FN" = "" ] ; then | 62 | if [ "$FN" = "" ] ; then |
63 | usage | 63 | usage |
64 | fi | 64 | fi |
65 | shift | 65 | shift 2 |
66 | shift | ||
67 | else | 66 | else |
68 | FN=.config | 67 | FN=.config |
69 | fi | 68 | fi |
@@ -76,26 +75,34 @@ while [ "$1" != "" ] ; do | |||
76 | CMD="$1" | 75 | CMD="$1" |
77 | shift | 76 | shift |
78 | case "$CMD" in | 77 | case "$CMD" in |
79 | --enable|-e) | 78 | --refresh) |
79 | ;; | ||
80 | --*-after) | ||
81 | checkarg "$1" | ||
82 | A=$ARG | ||
83 | checkarg "$2" | ||
84 | B=$ARG | ||
85 | shift 2 | ||
86 | ;; | ||
87 | --*) | ||
80 | checkarg "$1" | 88 | checkarg "$1" |
81 | set_var "CONFIG_$ARG" "CONFIG_$ARG=y" | ||
82 | shift | 89 | shift |
83 | ;; | 90 | ;; |
91 | esac | ||
92 | case "$CMD" in | ||
93 | --enable|-e) | ||
94 | set_var "CONFIG_$ARG" "CONFIG_$ARG=y" | ||
95 | ;; | ||
84 | 96 | ||
85 | --disable|-d) | 97 | --disable|-d) |
86 | checkarg "$1" | ||
87 | set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set" | 98 | set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set" |
88 | shift | ||
89 | ;; | 99 | ;; |
90 | 100 | ||
91 | --module|-m) | 101 | --module|-m) |
92 | checkarg "$1" | ||
93 | set_var "CONFIG_$ARG" "CONFIG_$ARG=m" | 102 | set_var "CONFIG_$ARG" "CONFIG_$ARG=m" |
94 | shift | ||
95 | ;; | 103 | ;; |
96 | 104 | ||
97 | --state|-s) | 105 | --state|-s) |
98 | checkarg "$1" | ||
99 | if grep -q "# CONFIG_$ARG is not set" $FN ; then | 106 | if grep -q "# CONFIG_$ARG is not set" $FN ; then |
100 | echo n | 107 | echo n |
101 | else | 108 | else |
@@ -108,37 +115,18 @@ while [ "$1" != "" ] ; do | |||
108 | echo "$V" | 115 | echo "$V" |
109 | fi | 116 | fi |
110 | fi | 117 | fi |
111 | shift | ||
112 | ;; | 118 | ;; |
113 | 119 | ||
114 | --enable-after|-E) | 120 | --enable-after|-E) |
115 | checkarg "$1" | ||
116 | A=$ARG | ||
117 | checkarg "$2" | ||
118 | B=$ARG | ||
119 | set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A" | 121 | set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A" |
120 | shift | ||
121 | shift | ||
122 | ;; | 122 | ;; |
123 | 123 | ||
124 | --disable-after|-D) | 124 | --disable-after|-D) |
125 | checkarg "$1" | ||
126 | A=$ARG | ||
127 | checkarg "$2" | ||
128 | B=$ARG | ||
129 | set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A" | 125 | set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A" |
130 | shift | ||
131 | shift | ||
132 | ;; | 126 | ;; |
133 | 127 | ||
134 | --module-after|-M) | 128 | --module-after|-M) |
135 | checkarg "$1" | ||
136 | A=$ARG | ||
137 | checkarg "$2" | ||
138 | B=$ARG | ||
139 | set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A" | 129 | set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A" |
140 | shift | ||
141 | shift | ||
142 | ;; | 130 | ;; |
143 | 131 | ||
144 | # undocumented because it ignores --file (fixme) | 132 | # undocumented because it ignores --file (fixme) |