mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 06:08:08 +00:00
some shell variable handling fixes
SVN-Revision: 7638
This commit is contained in:
parent
74f84753e7
commit
5e6f8739be
@ -55,7 +55,7 @@ config_rename() {
|
|||||||
local oldvar
|
local oldvar
|
||||||
local newvar
|
local newvar
|
||||||
|
|
||||||
[ "$OLD" -a "$NEW" ] || return
|
[ -n "$OLD" -a -n "$NEW" ] || return
|
||||||
for oldvar in `set | grep ^CONFIG_${OLD}_ | \
|
for oldvar in `set | grep ^CONFIG_${OLD}_ | \
|
||||||
sed -e 's/\(.*\)=.*$/\1/'` ; do
|
sed -e 's/\(.*\)=.*$/\1/'` ; do
|
||||||
newvar="CONFIG_${NEW}_${oldvar##CONFIG_${OLD}_}"
|
newvar="CONFIG_${NEW}_${oldvar##CONFIG_${OLD}_}"
|
||||||
@ -139,7 +139,7 @@ config_foreach() {
|
|||||||
[ -z "$CONFIG_SECTIONS" ] && return 0
|
[ -z "$CONFIG_SECTIONS" ] && return 0
|
||||||
for section in ${CONFIG_SECTIONS}; do
|
for section in ${CONFIG_SECTIONS}; do
|
||||||
config_get cfgtype "$section" TYPE
|
config_get cfgtype "$section" TYPE
|
||||||
[ -n "$type" -a "$cfgtype" != "$type" ] && continue
|
[ -n "$type" -a "x$cfgtype" != "x$type" ] && continue
|
||||||
eval "$function \"\$section\""
|
eval "$function \"\$section\""
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ strtok() { # <string> { <variable> [<separator>] ... }
|
|||||||
shift 2
|
shift 2
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ $# -gt 0 -a "$val" ]; then
|
if [ $# -gt 0 -a -n "$val" ]; then
|
||||||
export ${NO_EXPORT:+-n} "$1=$val"; count=$((count+1))
|
export ${NO_EXPORT:+-n} "$1=$val"; count=$((count+1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ uci_set() {
|
|||||||
( # spawn a subshell so you don't mess up the current environment
|
( # spawn a subshell so you don't mess up the current environment
|
||||||
uci_load "$PACKAGE"
|
uci_load "$PACKAGE"
|
||||||
config_get OLDVAL "$CONFIG" "$OPTION"
|
config_get OLDVAL "$CONFIG" "$OPTION"
|
||||||
if [ "$OLDVAL" != "$VALUE" ]; then
|
if [ "x$OLDVAL" != "x$VALUE" ]; then
|
||||||
config_get type "$CONFIG" TYPE
|
config_get type "$CONFIG" TYPE
|
||||||
[ -z "$type" ]
|
[ -z "$type" ]
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user