From: Florian Eckert Date: Thu, 8 Apr 2021 07:28:02 +0000 (+0200) Subject: uci: add uci_revert function X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fstaging%2Fmkresin.git;a=commitdiff_plain;h=92ac2a20ebba9f8695b464041cc8aeb30bb85576 uci: add uci_revert function Add missing uci_revert shell function wrapper. Signed-off-by: Florian Eckert --- diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index 2036f92a7e..1355955d1a 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uci -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git PKG_SOURCE_PROTO:=git diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh index 8d32cd1743..6ebfb73ae4 100644 --- a/package/system/uci/files/lib/config/uci.sh +++ b/package/system/uci/files/lib/config/uci.sh @@ -149,6 +149,14 @@ uci_remove_list() { /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} del_list "$PACKAGE.$CONFIG.$OPTION=$VALUE" } +uci_revert() { + local PACKAGE="$1" + local CONFIG="$2" + local OPTION="$3" + + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} revert "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}" +} + uci_commit() { local PACKAGE="$1" /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit $PACKAGE