]> git.99rst.org Git - openwrt-packages.git/commitdiff
nut: fix erroneous validation of STATEPATH
authorDaniel F. Dickinson <redacted>
Thu, 2 Jul 2026 22:16:00 +0000 (18:16 -0400)
committerJosef Schlehofer <redacted>
Wed, 15 Jul 2026 07:34:39 +0000 (09:34 +0200)
We should fallback to the default if one is not specified. In addition
find_statepath is the wrong place to check for its existence - it should
be created by the initscript if it does not exist.

See https://github.com/openwrt/packages/pull/29607#discussion_r3462976647

Signed-off-by: Daniel F. Dickinson <redacted>
net/nut/files/nut-service.sh.functions

index eb8b6631ecb6c8db28bb465435446a1a4a10cde3..29ecb384dddf62aa4a912851939e08c2816f1ba1 100644 (file)
@@ -210,10 +210,7 @@ find_statepath() {
        local nut_value_via_foreach=""
 
        find_foreach_value "$section_type" "$package" statepath "$NUT_BASE_STATEPATH" || return 1
-       # Modern OpenWrt (since at least OpenWrt-24.10 which is now old stable, we are developing for
-       # not yet released OpenWrt, so two versions later) supports readlink -f from busybox.
-       [ -n "$nut_value_via_foreach" ] || return 1
-       [ -d "$(readlink -f "$nut_value_via_foreach" 2>/dev/null)" ] || return 1
+       [ -n "$nut_value_via_foreach" ] || nut_value_via_foreach="$NUT_BASE_STATEPATH"
 
        # shellcheck disable=2034
        STATEPATH="$nut_value_via_foreach"
git clone https://git.99rst.org/PROJECT