alias debug=${DEBUG:-:}
# newline
-N="
+readonly N="
"
_C=0
local value="$2"
local sep="${3:- }"
- eval "$var=\"\${$var:+\${$var}${value:+$sep}}$value\""
+ eval "export -n -- \"$var=\${$var:+\${$var}\${value:+\$sep}}\$value\""
}
reset_cb() {
name="${name:-cfg${_C}}"
config_cb "$cfgtype" "$name"
CONFIG_SECTION="$name"
- eval CONFIG_${CONFIG_SECTION}_TYPE="$cfgtype"
+ export -n "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype"
}
option () {
local varname="$1"; shift
+ local value="$*"
- eval CONFIG_${CONFIG_SECTION}_${varname}="$*"
+ export -n "CONFIG_${CONFIG_SECTION}_${varname}=$value"
option_cb "$varname" "$*"
}
for oldvar in `set | grep ^CONFIG_${OLD}_ | \
sed -e 's/\(.*\)=.*$/\1/'` ; do
newvar="CONFIG_${NEW}_${oldvar##CONFIG_${OLD}_}"
- eval "$newvar=\${$oldvar}"
+ eval "export -n \"$newvar=\${$oldvar}\""
unset "$oldvar"
done
config_get() {
case "$3" in
"") eval "echo \"\${CONFIG_${1}_${2}}\"";;
- *) eval "$1=\"\${CONFIG_${2}_${3}}\"";;
+ *) eval "export -n -- \"$1=\${CONFIG_${2}_${3}}\"";;
esac
}
config_set() {
- eval CONFIG_${1}_${2}="$3"
+ local section="$1"
+ local option="$2"
+ local value="$3"
+ export -n "CONFIG_${section}_${option}=$value"
}
load_modules() {
val="${val#$tmp$2}"
- eval $1="$tmp"; count=$((count+1))
+ export -n "$1=$tmp"; count=$((count+1))
shift 2
done
if [ $# -gt 0 -a "$val" ]; then
- eval $1="$val"; count=$((count+1))
+ export -n "$1=$val"; count=$((count+1))
fi
return $count