Merge pull request #6383 from stangri/master-luci-app-pbr
authorStan Grishin <stangri@melmac.ca>
Thu, 11 May 2023 23:04:57 +0000 (17:04 -0600)
committerGitHub <noreply@github.com>
Thu, 11 May 2023 23:04:57 +0000 (17:04 -0600)
luci-app-pbr: opkg_get_version bugfix

applications/luci-app-pbr/Makefile
applications/luci-app-pbr/root/usr/libexec/rpcd/luci.pbr

index 97de24eef2a4ce4e6d33b56dd9504a307ad778f3..912db16fd197eda8c43a452a17686968ab51ffac 100644 (file)
@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Stan Grishin <stangri@melmac.ca>
-PKG_VERSION:=1.1.1-5
+PKG_VERSION:=1.1.1-7
 
 LUCI_TITLE:=Policy Based Routing Service Web UI
 LUCI_DESCRIPTION:=Provides Web UI for Policy Based Routing Service.
index 630bddf59ca3325789b3318715189071caf23003..57af8010f03ba87fd25ca31c6e7998863ca1e2b1 100755 (executable)
@@ -36,7 +36,7 @@ ubus_get_status() { ubus call service list "{ 'name': '$packageName' }" | jsonfi
 ubus_get_gateway() { ubus call service list "{ 'name': '$packageName' }" | jsonfilter -e "@['${packageName}'].instances.main.data.gateways[@.name='${1}']${2:+.$2}"; }
 is_greater() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" != "$1"; }
 is_greater_or_equal() { test "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$2"; }
-opkg_get_version() { grep -m1 -A1 "$1" '/usr/lib/opkg/status' | grep -m1 'Version: ' | sed 's|Version: \(.*\)|\1|'; }
+opkg_get_version() { grep -m1 -A1 "Package: $1$" '/usr/lib/opkg/status' | grep -m1 'Version: ' | sed 's|Version: \(.*\)|\1|'; }
 
 get_init_list() {
        local name
@@ -242,7 +242,7 @@ get_gateways() {
        echo -en "}}"
 }
 
-str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; }
+str_contains() { [ -n "$1" ] && [ -n "$2" ] && [ "${1//$2}" != "$1" ]; }
 str_contains_word() { echo "$1" | grep -q -w "$2"; }
 str_to_lower() { echo "$1" | tr 'A-Z' 'a-z'; }
 str_to_upper() { echo "$1" | tr 'a-z' 'A-Z'; }