From: Daniel F. Dickinson Date: Thu, 2 Jul 2026 22:16:00 +0000 (-0400) Subject: nut: fix erroneous validation of STATEPATH X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=c9cb2cfaa8ed55f1a01beafc458708988fbf7436;p=openwrt-packages.git nut: fix erroneous validation of STATEPATH 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 --- diff --git a/net/nut/files/nut-service.sh.functions b/net/nut/files/nut-service.sh.functions index eb8b6631e..29ecb384d 100644 --- a/net/nut/files/nut-service.sh.functions +++ b/net/nut/files/nut-service.sh.functions @@ -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"