Update install-php-extensions

pull/63/head
Quan TRAN 2019-12-18 13:53:29 +01:00 committed by Michele Locati
parent 40482177ab
commit 821cc51fc2
No known key found for this signature in database
GPG Key ID: 98B7CE2E7234E28B
1 changed files with 26 additions and 1 deletions

View File

@ -41,6 +41,22 @@ getDistro () {
fi fi
} }
# Get the distribution name with version
#
# Output:
# alpine<verion_id>|debian<verion_id>
getDistroVersion () {
getDistro_version_id=''
if test -r /etc/os-release; then
getDistro_version_id="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2)"
fi
if test -n "$getDistro_version_id"; then
printf '%s' "$(getDistro)$getDistro_version_id"
else
printf '%s' ''
fi
}
# Get the PHP Major-Minor version as an integer value, in format MMmm (example: 506 for PHP 5.6.15) # Get the PHP Major-Minor version as an integer value, in format MMmm (example: 506 for PHP 5.6.15)
# #
# Output: # Output:
@ -522,7 +538,13 @@ buildRequiredPackageLists () {
;; ;;
zip@debian) zip@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzip4 libmbedtls1?" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzip4 libmbedtls1?"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libssl-dev libzip-dev libbz2-dev libmbedtls-dev zlib1g-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libzip-dev libbz2-dev libmbedtls-dev zlib1g-dev"
if test -z "$(apt-cache search libssl1.0 | grep -E ^libssl)"; then
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssl-dev"
else
# Debian 9, uses libssl1.0 instead of libssl, due to conflict with libssh-dev
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssl1.0-dev"
fi
;; ;;
esac esac
done done
@ -620,6 +642,9 @@ expandPackagesToBeInstalled () {
# $@: the list of APT/APK packages to be installed # $@: the list of APT/APK packages to be installed
installRequiredPackages () { installRequiredPackages () {
printf '### INSTALLING REQUIRED PACKAGES ###\n' printf '### INSTALLING REQUIRED PACKAGES ###\n'
printf 'PACKAGES_PERSISTENT:\n%s\n' "$PACKAGES_PERSISTENT"
printf 'PACKAGES_VOLATILE:\n%s\n' "$PACKAGES_VOLATILE"
case "$(getDistro)" in case "$(getDistro)" in
alpine) alpine)
apk add $PACKAGES_PERSISTENT $PACKAGES_VOLATILE apk add $PACKAGES_PERSISTENT $PACKAGES_VOLATILE