aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/config
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-17 12:52:15 +0200
committerIngo Molnar <mingo@elte.hu>2009-06-17 12:56:49 +0200
commiteadb8a091b27a840de7450f84ecff5ef13476424 (patch)
tree58c3782d40def63baa8167f3d31e3048cb4c7660 /scripts/config
parent73874005cd8800440be4299bd095387fff4b90ac (diff)
parent65795efbd380a832ae508b04dba8f8e53f0b84d9 (diff)
downloadkernel_samsung_smdk4412-eadb8a091b27a840de7450f84ecff5ef13476424.zip
kernel_samsung_smdk4412-eadb8a091b27a840de7450f84ecff5ef13476424.tar.gz
kernel_samsung_smdk4412-eadb8a091b27a840de7450f84ecff5ef13476424.tar.bz2
Merge branch 'linus' into tracing/hw-breakpoints
Conflicts: arch/x86/Kconfig arch/x86/kernel/traps.c arch/x86/power/cpu.c arch/x86/power/cpu_32.c kernel/Makefile Semantic conflict: arch/x86/kernel/hw_breakpoint.c Merge reason: Resolve the conflicts, move from put_cpu_no_sched() to put_cpu() in arch/x86/kernel/hw_breakpoint.c. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'scripts/config')
-rwxr-xr-xscripts/config87
1 files changed, 41 insertions, 46 deletions
diff --git a/scripts/config b/scripts/config
index db6084b..608d7fd 100755
--- a/scripts/config
+++ b/scripts/config
@@ -9,8 +9,10 @@ config options command ...
commands:
--enable|-e option Enable option
--disable|-d option Disable option
- --module|-m option Turn option into a module
- --state|-s option Print state of option (n,y,m,undef)
+ --module|-m option Turn option into a module
+ --set-str option value
+ Set option to "value"
+ --state|-s option Print state of option (n,y,m,undef)
--enable-after|-E beforeopt option
Enable option directly after other option
@@ -26,8 +28,6 @@ options:
config doesn't check the validity of the .config file. This is done at next
make time.
-The options need to be already in the file before they can be changed,
-but sometimes you can cheat with the --*-after options.
EOL
exit 1
}
@@ -45,8 +45,18 @@ checkarg() {
ARG="`echo $ARG | tr a-z A-Z`"
}
-replace() {
- sed -i -e "$@" $FN
+set_var() {
+ local name=$1 new=$2 before=$3
+
+ name_re="^($name=|# $name is not set)"
+ before_re="^($before=|# $before is not set)"
+ if test -n "$before" && grep -Eq "$before_re" "$FN"; then
+ sed -ri "/$before_re/a $new" "$FN"
+ elif grep -Eq "$name_re" "$FN"; then
+ sed -ri "s:$name_re.*:$new:" "$FN"
+ else
+ echo "$new" >>"$FN"
+ fi
}
if [ "$1" = "--file" ]; then
@@ -54,8 +64,7 @@ if [ "$1" = "--file" ]; then
if [ "$FN" = "" ] ; then
usage
fi
- shift
- shift
+ shift 2
else
FN=.config
fi
@@ -68,27 +77,39 @@ 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"
- replace "s/# CONFIG_$ARG is not set/CONFIG_$ARG=y/"
shift
;;
+ esac
+ case "$CMD" in
+ --enable|-e)
+ set_var "CONFIG_$ARG" "CONFIG_$ARG=y"
+ ;;
--disable|-d)
- checkarg "$1"
- replace "s/CONFIG_$ARG=[my]/# CONFIG_$ARG is not set/"
- shift
+ set_var "CONFIG_$ARG" "# CONFIG_$ARG is not set"
;;
--module|-m)
- checkarg "$1"
- replace "s/CONFIG_$ARG=y/CONFIG_$ARG=m/" \
- -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=m/"
+ set_var "CONFIG_$ARG" "CONFIG_$ARG=m"
+ ;;
+
+ --set-str)
+ set_var "CONFIG_$ARG" "CONFIG_$ARG=\"$1\""
shift
;;
--state|-s)
- checkarg "$1"
if grep -q "# CONFIG_$ARG is not set" $FN ; then
echo n
else
@@ -101,44 +122,18 @@ while [ "$1" != "" ] ; do
echo "$V"
fi
fi
- shift
;;
--enable-after|-E)
- checkarg "$1"
- A=$ARG
- checkarg "$2"
- B=$ARG
- replace "/CONFIG_$A=[my]/aCONFIG_$B=y" \
- -e "/# CONFIG_$ARG is not set/a/CONFIG_$ARG=y" \
- -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=y/"
- shift
- shift
+ set_var "CONFIG_$B" "CONFIG_$B=y" "CONFIG_$A"
;;
--disable-after|-D)
- checkarg "$1"
- A=$ARG
- checkarg "$2"
- B=$ARG
- replace "/CONFIG_$A=[my]/a# CONFIG_$B is not set" \
- -e "/# CONFIG_$ARG is not set/a/# CONFIG_$ARG is not set" \
- -e "s/CONFIG_$ARG=[my]/# CONFIG_$ARG is not set/"
- shift
- shift
+ set_var "CONFIG_$B" "# CONFIG_$B is not set" "CONFIG_$A"
;;
--module-after|-M)
- checkarg "$1"
- A=$ARG
- checkarg "$2"
- B=$ARG
- replace "/CONFIG_$A=[my]/aCONFIG_$B=m" \
- -e "/# CONFIG_$ARG is not set/a/CONFIG_$ARG=m" \
- -e "s/CONFIG_$ARG=y/CONFIG_$ARG=m/" \
- -e "s/# CONFIG_$ARG is not set/CONFIG_$ARG=m/"
- shift
- shift
+ set_var "CONFIG_$B" "CONFIG_$B=m" "CONFIG_$A"
;;
# undocumented because it ignores --file (fixme)