If the user removes all /lib/apk/packages/*.conffiles* files to prevent
sysupgrade from preserving configuration, the glob no longer matches and
sysupgrade ends up calling cat on a non-existent path:
cat: can't open '/lib/apk/packages/*.conffiles_static': No such file or directory
Fix this by using find cmd.
Signed-off-by: Nick Hainke <vincent@systemli.org>
Link: https://github.com/openwrt/openwrt/pull/22071
Signed-off-by: Robert Marko <robimarko@gmail.com>
' /usr/lib/opkg/status
elif [ -d /lib/apk/packages ]; then
conffiles=""
- for file in /lib/apk/packages/*.conffiles_static; do
+ for file in $(find /lib/apk/packages -name "*.conffiles_static" -type f); do
conffiles="$(echo -e "$(cat $file)\n$conffiles")"
done
echo "$conffiles"