From 51c455198da75a3c2617b5e068ea89d80f8826a6 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 6 Mar 2021 01:37:12 +0530 Subject: [PATCH] Fix gearman setup --- dist/index.js | 4 ++-- src/extensions.ts | 4 ++-- src/scripts/ext/gearman.sh | 17 ++++++++--------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dist/index.js b/dist/index.js index 7218d410..a96bf640 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1980,14 +1980,14 @@ async function addExtensionLinux(extension_csv, version) { // match couchbase, pdo_oci, oci8, http, pecl_http // match 5.3ioncube...7.4ioncube, 5.3geos...7.4geos // match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4 - // match 5.6gearman...7.4gearman + // match 5.6gearman...8.1gearman case /^(5\.[3-6]|7\.[0-4]|8\.0)blackfire(-\d+\.\d+\.\d+)?$/.test(version_extension): case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(version_extension): case /^couchbase$|^pdo_oci$|^oci8$|^http|^pecl_http|^pdo_firebird$/.test(extension): case /^(5\.6|7\.[0-4]|8\.0)intl-[\d]+\.[\d]+$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4])(ioncube|geos)$/.test(version_extension): case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): - case /^((5\.6)|(7\.[0-4]))gearman$/.test(version_extension): + case /^(5\.[3-6]|7\.[0-4]|8\.[0-9])gearman$/.test(version_extension): add_script += await utils.customPackage(ext_name, 'ext', extension, 'linux'); return; // match pre-release versions. For example - xdebug-beta diff --git a/src/extensions.ts b/src/extensions.ts index 5a6b672b..2f85f54b 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -249,7 +249,7 @@ export async function addExtensionLinux( // match couchbase, pdo_oci, oci8, http, pecl_http // match 5.3ioncube...7.4ioncube, 5.3geos...7.4geos // match 7.0phalcon3...7.3phalcon3 and 7.2phalcon4...7.4phalcon4 - // match 5.6gearman...7.4gearman + // match 5.6gearman...8.1gearman case /^(5\.[3-6]|7\.[0-4]|8\.0)blackfire(-\d+\.\d+\.\d+)?$/.test( version_extension ): @@ -262,7 +262,7 @@ export async function addExtensionLinux( case /^(5\.6|7\.[0-4]|8\.0)intl-[\d]+\.[\d]+$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4])(ioncube|geos)$/.test(version_extension): case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): - case /^((5\.6)|(7\.[0-4]))gearman$/.test(version_extension): + case /^(5\.[3-6]|7\.[0-4]|8\.[0-9])gearman$/.test(version_extension): add_script += await utils.customPackage( ext_name, 'ext', diff --git a/src/scripts/ext/gearman.sh b/src/scripts/ext/gearman.sh index bf3e8681..0a59eba5 100644 --- a/src/scripts/ext/gearman.sh +++ b/src/scripts/ext/gearman.sh @@ -1,17 +1,16 @@ # Helper function to add gearman extension. add_gearman_helper() { - sudo "${debconf_fix:?}" add-apt-repository ppa:ondrej/pkg-gearman -y - if [ -e "${ext_dir:?}/gearman.so" ] && [ "$DISTRIB_RELEASE" != "16.04" ]; then - ${apt_install:?} libgearman-dev - echo "extension=gearman.so" | sudo tee -a "${scan_dir:?}/20-gearman.ini" >/dev/null 2>&1 - else + add_ppa ondrej/pkg-gearman + install_packages libgearman-dev + enable_extension gearman extension + if ! check_extension gearman; then status="Installed and enabled" - if [ "$DISTRIB_RELEASE" = "16.04" ]; then - sudo "${debconf_fix:?}" apt-get update -y - ${apt_install:?} php"${version:?}"-gearman + if [[ "${version:?}" =~ 5.[3-5] ]]; then + pecl_install gearman-1.1.2 else - ${apt_install:?} libgearman-dev php"${version:?}"-gearman + install_packages php"${version:?}"-gearman || pecl_install gearman fi + enable_extension gearman extension fi }