php8: adapt test.sh for upcoming opkg -> apk transition
authorMichael Heimpold <redacted>
Tue, 13 May 2025 05:33:11 +0000 (07:33 +0200)
committerMichael Heimpold <redacted>
Sat, 17 May 2025 15:25:18 +0000 (17:25 +0200)
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 <redacted>
lang/php8/test.sh

index 7b2de6ee7679488d1b739ac9b3cdb6e558d63018..bfa3fefd6de12756ac2883b3e02c0792a4bac4bc 100644 (file)
@@ -14,7 +14,11 @@ case "$1" in
                PHP_MOD="${1#php8-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"
                ;;
git clone https://git.99rst.org/PROJECT