base-files: remove config_clear() and list_remove()
authorFelix Fietkau <nbd@openwrt.org>
Mon, 7 Apr 2014 10:01:59 +0000 (10:01 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 7 Apr 2014 10:01:59 +0000 (10:01 +0000)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
SVN-Revision: 40409

package/base-files/files/lib/functions.sh

index cec78c506229ea11bcab37c5b0fd81c02bcb83e5..42886b1466e3d74297373ee982be210c5deca05d 100755 (executable)
@@ -34,21 +34,6 @@ list_contains() {
        [ "${val%% $str *}" != "$val" ]
 }
 
-list_remove() {
-       local var="$1"
-       local remove="$2"
-       local val
-
-       eval "val=\" \${$var} \""
-       val1="${val%% $remove *}"
-       [ "$val1" = "$val" ] && return
-       val2="${val##* $remove }"
-       [ "$val2" = "$val" ] && return
-       val="${val1## } ${val2%% }"
-       val="${val%% }"
-       eval "export ${NO_EXPORT:+-n} -- \"$var=\$val\""
-}
-
 config_load() {
        [ -n "$IPKG_INSTROOT" ] && return 0
        uci_load "$@"
@@ -121,19 +106,6 @@ config_unset() {
        config_set "$1" "$2" ""
 }
 
-config_clear() {
-       local SECTION="$1"
-       local oldvar
-
-       list_remove CONFIG_SECTIONS "$SECTION"
-       export ${NO_EXPORT:+-n} CONFIG_SECTIONS="${SECTION:+$CONFIG_SECTIONS}"
-
-       for oldvar in `set | grep ^CONFIG_${SECTION:+${SECTION}_} | \
-               sed -e 's/\(.*\)=.*$/\1/'` ; do
-               unset $oldvar
-       done
-}
-
 # config_get <variable> <section> <option> [<default>]
 # config_get <section> <option>
 config_get() {