uci: add uci_revert function
authorFlorian Eckert <fe@dev.tdt.de>
Thu, 8 Apr 2021 07:28:02 +0000 (09:28 +0200)
committerPaul Spooren <mail@aparcar.org>
Mon, 21 Jun 2021 18:36:03 +0000 (08:36 -1000)
Add missing uci_revert shell function wrapper.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
package/system/uci/Makefile
package/system/uci/files/lib/config/uci.sh

index 2036f92a7e70b9eae5d896d237e66a9d167b7d3b..1355955d1aa6fb7b823d3681038c4b26c165ff7a 100644 (file)
@@ -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
index 8d32cd1743267e05a579dd234c5d79f5491be389..6ebfb73ae440195a61f22b0f1e861231d87bffaf 100644 (file)
@@ -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