allow scripts to disable config callbacks
authorFelix Fietkau <nbd@openwrt.org>
Wed, 11 Apr 2007 19:34:20 +0000 (19:34 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 11 Apr 2007 19:34:20 +0000 (19:34 +0000)
SVN-Revision: 6934

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

index 72e60bb511cca29356131afdcab17c0d467f7811..dac46a34977b5d0646f5e44f523348d518f6e6ca 100755 (executable)
@@ -36,7 +36,7 @@ config () {
        export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1))
        name="${name:-cfg$CONFIG_NUM_SECTIONS}"
        append CONFIG_SECTIONS "$name"
-       config_cb "$cfgtype" "$name"
+       [ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name"
        export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
        export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype"
 }
@@ -46,7 +46,7 @@ option () {
        local value="$*"
        
        export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_${varname}=$value"
-       option_cb "$varname" "$*"
+       [ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*"
 }
 
 config_rename() {