docker-php-extension-installer/scripts/ci-filter-supported-extensions

41 lines
903 B
Plaintext
Raw Normal View History

2020-02-21 13:10:49 +01:00
#!/bin/sh
# Let's set a sane environment
set -o errexit
set -o nounset
set -o noglob
SCRIPTS_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
. "$SCRIPTS_DIR/common"
ROOT_DIR="$(dirname -- "$SCRIPTS_DIR")"
DATA_DIR="$ROOT_DIR/data"
EXTENSIONS_LIST="${1:-}"
if test -z "$EXTENSIONS_LIST"; then
echo 'Extensions list not specified' >&2
exit 1
fi
ALL_SUPPORTED_EXTENSIONS="$(cat "$DATA_DIR/supported-extensions")"
SUPPORTED_EXTENSIONS=''
resetIFS
for EXTENSION in $EXTENSIONS_LIST; do
printf 'Checking extension "%s"... ' "$EXTENSION" >&2
2021-01-17 15:27:09 +01:00
case "$EXTENSION" in
pecl_http)
EXTENSION=http
printf '(using %s) ' "$EXTENSION" >&2
;;
esac
2020-02-21 13:10:49 +01:00
if printf '%s' "$ALL_SUPPORTED_EXTENSIONS" | grep -q "^$EXTENSION\s"; then
printf 'supported.\n' >&2
SUPPORTED_EXTENSIONS="$SUPPORTED_EXTENSIONS $EXTENSION"
else
2020-02-21 22:01:48 +01:00
printf 'NOT supported.\n' >&2
2020-02-21 13:10:49 +01:00
fi
done
printf '%s' "${SUPPORTED_EXTENSIONS# }"