From f15031994ba229a46147a4b328de7588997cee2e Mon Sep 17 00:00:00 2001 From: Fred Cox Date: Fri, 18 Sep 2020 21:02:07 +0300 Subject: [PATCH] fixes for enchant extension on alpine3.12 disable enchant on some version/distro combos --- .github/workflows/test-extensions.yml | 1 + data/special-requirements | 1 + install-php-extensions | 13 ++++++++++--- scripts/ci-test-extensions | 17 ++++++++++++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-extensions.yml b/.github/workflows/test-extensions.yml index 06662fb..2533327 100644 --- a/.github/workflows/test-extensions.yml +++ b/.github/workflows/test-extensions.yml @@ -51,6 +51,7 @@ jobs: - alpine3.9 - alpine3.10 - alpine3.11 + - alpine3.12 - jessie - stretch - buster diff --git a/data/special-requirements b/data/special-requirements index 9b5a884..a7666b6 100644 --- a/data/special-requirements +++ b/data/special-requirements @@ -1,3 +1,4 @@ parallel zts pthreads zts tdlib !alpine3.7 !jessie +enchant !7.2-alpine3.12 !7.3-alpine3.12 !7.4-alpine3.12 diff --git a/install-php-extensions b/install-php-extensions index 3f128e2..35989bf 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -27,7 +27,9 @@ setDistro() { exit 1 fi DISTRO="$(cat /etc/os-release | grep -E ^ID= | cut -d = -f 2)" - DISTRO_VERSION="$(printf '%s@%s' $DISTRO $(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2))" + DISTRO_VERSION_NUMBER="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2 | cut -d '"' -f 2 | cut -d . -f 1,2)" + DISTRO_VERSION="$(printf '%s@%s' $DISTRO $DISTRO_VERSION_NUMBER)" + DISTRO_MAJMIN_VERSION="$(echo "$DISTRO_VERSION_NUMBER" | awk -F. '{print $1*100+$2}')" } # Set the PHP_MAJMIN_VERSION variable containing the PHP Major-Minor version as an integer value, in format MMmm (example: 506 for PHP 5.6.15) @@ -241,8 +243,13 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev" ;; enchant@alpine) - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant-dev" + if test $DISTRO_MAJMIN_VERSION -ge 312; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" + else + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant-dev" + fi ;; enchant@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant1c2a" diff --git a/scripts/ci-test-extensions b/scripts/ci-test-extensions index 01f0ebb..af11872 100755 --- a/scripts/ci-test-extensions +++ b/scripts/ci-test-extensions @@ -211,7 +211,22 @@ getAllPHPVersionsForExtension() { fi done done <"$CI_BUILD_DIR/data/supported-extensions" - printf '%s' "$getAllPHPVersionsForExtension_result" + + filterUnsupportedExensionsForDistro_reqs="$CI_BUILD_DIR/data/special-requirements" + if test -f "$filterUnsupportedExensionsForDistro_reqs"; then + getAllPHPVersionsForExtension_filtered_result='' + for getAllPHPVersionsForExtension_result_filter in $getAllPHPVersionsForExtension_result; do + if stringInList "!$getAllPHPVersionsForExtension_result_filter-$DOCKER_DISTRO" "$(cat "$filterUnsupportedExensionsForDistro_reqs" | grep -E "^$1[ \t]")"; then + printf 'Note: extension "%s" is not supported for distro "%s" using php "%s"\n' "$1" "$DOCKER_DISTRO" "$getAllPHPVersionsForExtension_result_filter" >/dev/stderr + else + getAllPHPVersionsForExtension_filtered_result="$getAllPHPVersionsForExtension_filtered_result $getAllPHPVersionsForExtension_result_filter" + fi + done + else + getAllPHPVersionsForExtension_filtered_result="$getAllPHPVersionsForExtension_result" + fi + + printf '%s' "${getAllPHPVersionsForExtension_filtered_result# }" } # Test extensions