aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-06-21 21:40:48 +0200
committerHans Dedecker <dedeckeh@gmail.com>2018-06-21 21:43:03 +0200
commitc2da3505e21ba8d34d99d90c3054ba6db07c0544 (patch)
treed1d21ace1d7a18bded987b1301842199077e5209 /package/base-files/files
parentb72bced2d77178b5b1e3ee9b76566dc7a3d5e251 (diff)
downloadupstream-c2da3505e21ba8d34d99d90c3054ba6db07c0544.tar.gz
upstream-c2da3505e21ba8d34d99d90c3054ba6db07c0544.tar.bz2
upstream-c2da3505e21ba8d34d99d90c3054ba6db07c0544.zip
Revert "base-files: fix UCI config parsing and callback handling"
This reverts commit 023944853241920c20842c0f4649d1dd4e7e273b as users report Qos scripts are broken (FS#1602) Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'package/base-files/files')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 318e91856b..197aef10ef 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -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() {