1
0
Fork 0
mirror of https://github.com/mlocati/docker-php-extension-installer synced 2025-05-09 08:32:42 +00:00

Allow specifying stability when wanting a compatible PECL version (#833)

This commit is contained in:
Michele Locati 2023-11-09 15:01:33 +01:00 committed by GitHub
parent a73618bc03
commit 02c0e027bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 6 deletions

View file

@ -5,7 +5,8 @@ set -o errexit
set -o nounset
WANTED_VERSION="${1:-}"
WANTED_VERSION_AFTERCARET="${1#^}"
WANTED_VERSION_BASE="${1#^}"
WANTED_VERSION_BASE="${WANTED_VERSION_BASE%@*}"
INSTALLME=xdebug
if test -n "$WANTED_VERSION"; then
INSTALLME="$INSTALLME-$1"
@ -18,7 +19,7 @@ if test -z "$WANTED_VERSION"; then
printf 'Installing the default version worked (we installed version %s)\n' "$INSTALLED_VERSION"
elif test "$WANTED_VERSION" = "$INSTALLED_VERSION"; then
printf 'Installing specific version %s worked\n' "$WANTED_VERSION"
elif test "$WANTED_VERSION" != "$WANTED_VERSION_AFTERCARET" && test "${INSTALLED_VERSION#$WANTED_VERSION_AFTERCARET.}" != "$INSTALLED_VERSION"; then
elif test "$WANTED_VERSION" != "$WANTED_VERSION_BASE" && test "${INSTALLED_VERSION#$WANTED_VERSION_BASE.}" != "$INSTALLED_VERSION"; then
printf 'Installing version compatible with %s worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
else
printf 'We wanted to install version %s, but we installed %s\n' "$WANTED_VERSION" "$INSTALLED_VERSION" >&2