From c342ca379eae4f96b2f3a66e5487cc400e89b7b6 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 11 Mar 2021 07:29:43 +0530 Subject: [PATCH] Check if the extensions has to be built from source first --- dist/index.js | 24 +++++++++++----------- src/extensions.ts | 52 +++++++++++++++++++++++------------------------ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/dist/index.js b/dist/index.js index 489f7b13..f2fdbc84 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1811,6 +1811,12 @@ async function addExtensionDarwin(extension_csv, version) { case /^:/.test(ext_name): remove_script += '\nremove_extension ' + ext_name.slice(1); return; + // match extensions from GitHub. Do this before checking for semver as + // the version may match that as well + case /.+-.+\/.+@.+/.test(extension): + matches = /.+-(.+)\/(.+)@(.+)/.exec(extension); + add_script += await utils.joins('\nadd_extension_from_github', ext_name, matches[1], matches[2], matches[3], ext_prefix); + return; // match 5.3blackfire...8.0blackfire // match 5.3blackfire-(semver)...8.0blackfire-(semver) // match couchbase, pdo_oci, oci8, http, pecl_http @@ -1826,12 +1832,6 @@ async function addExtensionDarwin(extension_csv, version) { case /.+-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(extension): add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix); return; - // match extensions from GitHub. Do this before checking for semver as - // the version may match that as well - case /.+-.+\/.+@.+/.test(extension): - matches = /.+-(.+)\/(.+)@(.+)/.exec(extension); - add_script += await utils.joins('\nadd_extension_from_github', ext_name, matches[1], matches[2], matches[3], ext_prefix); - return; // match semver case /.+-\d+\.\d+\.\d+.*/.test(extension): add_script += await utils.joins('\nadd_pecl_extension', ext_name, ext_version, ext_prefix); @@ -1964,6 +1964,12 @@ async function addExtensionLinux(extension_csv, version) { case /^:/.test(ext_name): remove_script += '\nremove_extension ' + ext_name.slice(1); return; + // match extensions from GitHub. Do this before checking for semver as + // the version may match that as well + case /.+-.+\/.+@.+/.test(extension): + matches = /.+-(.+)\/(.+)@(.+)/.exec(extension); + add_script += await utils.joins('\nadd_extension_from_github', ext_name, matches[1], matches[2], matches[3], ext_prefix); + return; // match 5.3blackfire...8.0blackfire // match 5.3blackfire-(semver)...8.0blackfire-(semver) // match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid @@ -1984,12 +1990,6 @@ async function addExtensionLinux(extension_csv, version) { case /.+-(stable|beta|alpha|devel|snapshot|rc|preview)/.test(extension): add_script += await utils.joins('\nadd_unstable_extension', ext_name, ext_version, ext_prefix); return; - // match extensions from GitHub. Do this before checking for semver as - // the version may match that as well - case /.+-.+\/.+@.+/.test(extension): - matches = /.+-(.+)\/(.+)@(.+)/.exec(extension); - add_script += await utils.joins('\nadd_extension_from_github', ext_name, matches[1], matches[2], matches[3], ext_prefix); - return; // match semver versions case /.+-\d+\.\d+\.\d+.*/.test(extension): add_script += await utils.joins('\nadd_pecl_extension', ext_name, ext_version, ext_prefix); diff --git a/src/extensions.ts b/src/extensions.ts index e952a424..37063265 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -24,6 +24,19 @@ export async function addExtensionDarwin( case /^:/.test(ext_name): remove_script += '\nremove_extension ' + ext_name.slice(1); return; + // match extensions from GitHub. Do this before checking for semver as + // the version may match that as well + case /.+-.+\/.+@.+/.test(extension): + matches = /.+-(.+)\/(.+)@(.+)/.exec(extension) as RegExpExecArray; + add_script += await utils.joins( + '\nadd_extension_from_github', + ext_name, + matches[1], + matches[2], + matches[3], + ext_prefix + ); + return; // match 5.3blackfire...8.0blackfire // match 5.3blackfire-(semver)...8.0blackfire-(semver) // match couchbase, pdo_oci, oci8, http, pecl_http @@ -53,19 +66,6 @@ export async function addExtensionDarwin( ext_prefix ); return; - // match extensions from GitHub. Do this before checking for semver as - // the version may match that as well - case /.+-.+\/.+@.+/.test(extension): - matches = /.+-(.+)\/(.+)@(.+)/.exec(extension) as RegExpExecArray; - add_script += await utils.joins( - '\nadd_extension_from_github', - ext_name, - matches[1], - matches[2], - matches[3], - ext_prefix - ); - return; // match semver case /.+-\d+\.\d+\.\d+.*/.test(extension): add_script += await utils.joins( @@ -243,6 +243,19 @@ export async function addExtensionLinux( case /^:/.test(ext_name): remove_script += '\nremove_extension ' + ext_name.slice(1); return; + // match extensions from GitHub. Do this before checking for semver as + // the version may match that as well + case /.+-.+\/.+@.+/.test(extension): + matches = /.+-(.+)\/(.+)@(.+)/.exec(extension) as RegExpExecArray; + add_script += await utils.joins( + '\nadd_extension_from_github', + ext_name, + matches[1], + matches[2], + matches[3], + ext_prefix + ); + return; // match 5.3blackfire...8.0blackfire // match 5.3blackfire-(semver)...8.0blackfire-(semver) // match 5.3pdo_cubrid...7.2php_cubrid, 5.3cubrid...7.4cubrid @@ -279,19 +292,6 @@ export async function addExtensionLinux( ext_prefix ); return; - // match extensions from GitHub. Do this before checking for semver as - // the version may match that as well - case /.+-.+\/.+@.+/.test(extension): - matches = /.+-(.+)\/(.+)@(.+)/.exec(extension) as RegExpExecArray; - add_script += await utils.joins( - '\nadd_extension_from_github', - ext_name, - matches[1], - matches[2], - matches[3], - ext_prefix - ); - return; // match semver versions case /.+-\d+\.\d+\.\d+.*/.test(extension): add_script += await utils.joins(