fix unnamed config sections

SVN-Revision: 4321
This commit is contained in:
Felix Fietkau 2006-07-29 19:59:45 +00:00
parent a12f821123
commit 39a8c5b8ff

View file

@ -1,5 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2006 OpenWrt.org # Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2006 Fokus Fraunhofer <carsten.tittel@fokus.fraunhofer.de>
alias debug=${DEBUG:-:} alias debug=${DEBUG:-:}
@ -38,15 +39,17 @@ reset_cb() {
reset_cb reset_cb
config () { config () {
_C=$(($_C + 1)) local type="$1"
name="${name:-cfg${_C}}" local name="$2"
config_cb "$1" "$2" _C=$(($_C + 1))
export CONFIG_SECTION="$2" name="${name:-cfg${_C}}"
export CONFIG_${CONFIG_SECTION}_TYPE="$1" config_cb "$type" "$name"
export CONFIG_SECTION="$name"
export CONFIG_${CONFIG_SECTION}_TYPE="$type"
} }
option () { option () {
local varname="$1" ; shift local varname="$1"; shift
export CONFIG_${CONFIG_SECTION}_${varname}="$*" export CONFIG_${CONFIG_SECTION}_${varname}="$*"
option_cb "$varname" "$*" option_cb "$varname" "$*"
} }
@ -88,3 +91,9 @@ config_set() {
load_modules() { load_modules() {
sed 's/^[^#]/insmod &/' $* | ash 2>&- || : sed 's/^[^#]/insmod &/' $* | ash 2>&- || :
} }
include() {
for file in $(ls /lib/$1/*.sh 2>/dev/null); do
. $file
done
}