From 9ba2b2a8f042e3913b37b9d51b180c56ea46250c Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Mon, 5 Feb 2024 10:06:11 +0100 Subject: [PATCH] Fix installing datadog_trace when specifying the version (#881) --- install-php-extensions | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index 79ba515..2cfa8a1 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -387,7 +387,8 @@ resolvePHPModuleVersion() { resolvePHPModuleVersion_wantedVersion="$resolvePHPModuleVersion_afterCaret" ;; esac - resolvePHPModuleVersion_xml="$(curl -sSLf "http://pecl.php.net/rest/r/$resolvePHPModuleVersion_module/allreleases.xml")" + resolvePHPModuleVersion_peclModule="$(getPeclModuleName "$resolvePHPModuleVersion_module")" + resolvePHPModuleVersion_xml="$(curl -sSLf "http://pecl.php.net/rest/r/$resolvePHPModuleVersion_peclModule/allreleases.xml")" # remove line endings, collapse spaces resolvePHPModuleVersion_versions="$(printf '%s' "$resolvePHPModuleVersion_xml" | tr -s ' \t\r\n' ' ')" # one line per release (eg 1.2.3stable) @@ -449,7 +450,8 @@ resolvePeclStabilityVersion() { return ;; esac - peclStabilityFlagToVersion_url="http://pecl.php.net/rest/r/$1/$2.txt" + resolvePeclStabilityVersion_peclModule="$(getPeclModuleName "$1")" + peclStabilityFlagToVersion_url="http://pecl.php.net/rest/r/$resolvePeclStabilityVersion_peclModule/$2.txt" if ! peclStabilityFlagToVersion_result="$(curl -sSLf "$peclStabilityFlagToVersion_url")"; then peclStabilityFlagToVersion_result='' fi @@ -2760,9 +2762,12 @@ installRemoteModule() { if test -z "$installRemoteModule_version"; then if test $PHP_MAJMIN_VERSION -lt 700; then installRemoteModule_version=0.75.0 - else - installCargo fi + else + installRemoteModule_version="$(resolvePeclStabilityVersion "$installRemoteModule_module" "$installRemoteModule_version")" + fi + if test -z "$installRemoteModule_version" || test $(compareVersions "$installRemoteModule_version" 0.75.0) -ge 0; then + installCargo fi ;; decimal)