Revert "base-files: fix UCI config parsing and callback handling"
authorHans Dedecker <dedeckeh@gmail.com>
Thu, 21 Jun 2018 19:40:48 +0000 (21:40 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Thu, 21 Jun 2018 19:43:03 +0000 (21:43 +0200)
This reverts commit 023944853241920c20842c0f4649d1dd4e7e273b as users
report Qos scripts are broken (FS#1602)

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
package/base-files/Makefile
package/base-files/files/lib/functions.sh

index 89ee0be3154ef6a6f3d1351a811babf796b035ea..7175daec3a0a1a3ecd08ceee4d06e2c0eae4b29a 100644 (file)
@@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=191
+PKG_RELEASE:=190
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
index 318e91856b451e95db03506c3bb9795f69a7b56f..197aef10eff310f552509bdb88e25e7e17ba93ec 100755 (executable)
@@ -57,16 +57,16 @@ config () {
        export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1))
        name="${name:-cfg$CONFIG_NUM_SECTIONS}"
        append CONFIG_SECTIONS "$name"
-       export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
-       config_set "$CONFIG_SECTION" "TYPE" "${cfgtype}"
        [ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name"
+       export ${NO_EXPORT:+-n} CONFIG_SECTION="$name"
+       export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype"
 }
 
 option () {
        local varname="$1"; shift
        local value="$*"
 
-       config_set "$CONFIG_SECTION" "${varname}" "${value}"
+       export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_${varname}=$value"
        [ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*"
 }
 
@@ -81,7 +81,7 @@ list() {
        config_set "$CONFIG_SECTION" "${varname}_ITEM$len" "$value"
        config_set "$CONFIG_SECTION" "${varname}_LENGTH" "$len"
        append "CONFIG_${CONFIG_SECTION}_${varname}" "$value" "$LIST_SEP"
-       [ -n "$NO_CALLBACK" ] || list_cb "$varname" "$*"
+       list_cb "$varname" "$*"
 }
 
 config_unset() {
@@ -113,8 +113,11 @@ config_set() {
        local section="$1"
        local option="$2"
        local value="$3"
+       local old_section="$CONFIG_SECTION"
 
-       export ${NO_EXPORT:+-n} "CONFIG_${section}_${option}=${value}"
+       CONFIG_SECTION="$section"
+       option "$option" "$value"
+       CONFIG_SECTION="$old_section"
 }
 
 config_foreach() {