From: Oldřich Jedlička Date: Sun, 8 Nov 2020 15:15:04 +0000 (+0100) Subject: base-files: allow reusing of boolean value extraction logic X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=49d678f0d29405883e0789297a476154eef18ec5;p=openwrt%2Fstaging%2Fjow.git base-files: allow reusing of boolean value extraction logic The `functions.sh` script has `config_get_bool()` function, which is usable when using UCI config direct access API, but there is no equivalent for the callback API. Introduce `get_bool()` function to allow reusing it from init scripts. Example: ```sh option_cb() { local option="$1" local value="$(get_bool "$2")" ... } ``` Signed-off-by: Oldřich Jedlička --- diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 35a07f2aad..da3976424f 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=243 +PKG_RELEASE:=244 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index ee4ad1af83..272e230db2 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -118,15 +118,22 @@ config_get() { esac } -# config_get_bool