php8: adapt test.sh for upcoming opkg -> apk transition

We used to rely on opkg to install the CLI tool for testing
PHP modules, but when opkg is not available anymore, we have to
use apk. The (simple) switch logic assumes, that only one
of both package manager tools is installed.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
This commit is contained in:
Michael Heimpold 2025-05-13 07:33:11 +02:00
parent 8d999cfc50
commit f21bc7f170
1 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,11 @@ case "$1" in
PHP_MOD="${1#php8-mod-}" PHP_MOD="${1#php8-mod-}"
PHP_MOD="${PHP_MOD//-/_}" PHP_MOD="${PHP_MOD//-/_}"
opkg install php8-cli if command -v opkg >/dev/null 2>&1; then
opkg install php8-cli
else
apk add php8-cli
fi
php8-cli -m | grep -i "$PHP_MOD" php8-cli -m | grep -i "$PHP_MOD"
;; ;;