Add support to specify couchbase version

This commit is contained in:
Shivam Mathur 2022-05-19 23:56:27 +05:30
parent 6f83b63bf5
commit 1dfe0dc4a4
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
3 changed files with 14 additions and 10 deletions

4
dist/index.js vendored
View File

@ -243,7 +243,7 @@ async function addExtensionDarwin(extension_csv, version) {
add_script += await utils.parseExtensionSource(extension, ext_prefix); add_script += await utils.parseExtensionSource(extension, ext_prefix);
return; return;
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(version_extension):
case /^couchbase$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(extension): case /^couchbase|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(extension):
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension): case /(5\.6|7\.[0-3])phalcon3|7\.[2-4]phalcon4/.test(version_extension):
case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension): case /(?<!5\.[3-6])(pdo_)?sqlsrv$/.test(version_extension):
@ -357,7 +357,7 @@ async function addExtensionLinux(extension_csv, version) {
return; return;
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])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 /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(version_extension):
case /^couchbase$|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(extension): case /^couchbase|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(extension):
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension): case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension):

View File

@ -39,7 +39,7 @@ export async function addExtensionDarwin(
case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test( case /^(5\.[3-6]|7\.[0-4]|8\.[0-1])blackfire(-\d+\.\d+\.\d+)?$/.test(
version_extension version_extension
): ):
case /^couchbase$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test( case /^couchbase|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
extension extension
): ):
case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4])ioncube$/.test(version_extension):
@ -262,7 +262,7 @@ export async function addExtensionLinux(
case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test( case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(
version_extension version_extension
): ):
case /^couchbase$|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test( case /^couchbase|^gearman$|^geos$|^pdo_oci$|^oci8$|^(pecl_)?http|^pdo_firebird$/.test(
extension extension
): ):
case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension): case /(?<!5\.[3-5])intl-[\d]+\.[\d]+$/.test(version_extension):

View File

@ -1,8 +1,9 @@
# Function to install libraries required by couchbase # Function to install libraries required by couchbase
add_couchbase_clibs() { add_couchbase_clibs() {
ext=$1
if [ "$(uname -s)" = "Linux" ]; then if [ "$(uname -s)" = "Linux" ]; then
trunk="https://github.com/couchbase/libcouchbase/releases" trunk="https://github.com/couchbase/libcouchbase/releases"
if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then if [[ "$ext" =~ couchbase-2.+ ]]; then
release="2.10.9" release="2.10.9"
else else
release="$(curl -sL $trunk/latest | grep -Eo "libcouchbase-[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -d'-' -f 2)" release="$(curl -sL $trunk/latest | grep -Eo "libcouchbase-[0-9]+\.[0-9]+\.[0-9]+" | head -n 1 | cut -d'-' -f 2)"
@ -15,7 +16,7 @@ add_couchbase_clibs() {
install_packages libev4 libevent-dev install_packages libev4 libevent-dev
sudo dpkg -i /tmp/libcouchbase-*/*.deb sudo dpkg -i /tmp/libcouchbase-*/*.deb
else else
if [[ ${version:?} =~ 5.[3-6]|7.[0-1] ]]; then if [[ "$ext" =~ couchbase-2.+ ]]; then
brew install libcouchbase@2 brew install libcouchbase@2
brew link --overwrite --force libcouchbase@2 brew link --overwrite --force libcouchbase@2
else else
@ -64,9 +65,12 @@ get_couchbase_version() {
# Function to add couchbase. # Function to add couchbase.
add_couchbase() { add_couchbase() {
couchbase_version=$(get_couchbase_version) ext=$1
if [ "$couchbase_version" != 'couchbase' ]; then if [ "$ext" = "couchbase" ]; then
add_couchbase_clibs >/dev/null 2>&1 ext=$(get_couchbase_version)
fi
if [[ "$ext" =~ couchbase-[2-3].+ ]]; then
add_couchbase_clibs "$ext" >/dev/null 2>&1
else else
add_couchbase_cxxlibs >/dev/null 2>&1 add_couchbase_cxxlibs >/dev/null 2>&1
fi fi
@ -74,7 +78,7 @@ add_couchbase() {
if check_extension "couchbase"; then if check_extension "couchbase"; then
add_log "${tick:?}" "couchbase" "Enabled" add_log "${tick:?}" "couchbase" "Enabled"
else else
pecl_install "${couchbase_version}" >/dev/null 2>&1 pecl_install "${ext}" >/dev/null 2>&1
add_extension_log "couchbase" "Installed and enabled" add_extension_log "couchbase" "Installed and enabled"
fi fi
} }