Skip to content

Commit

Permalink
Check if the extensions has to be built from source first
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Apr 15, 2021
1 parent cc31640 commit c342ca3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
24 changes: 12 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down
52 changes: 26 additions & 26 deletions src/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c342ca3

Please sign in to comment.