Skip to content

Commit eaaab1c

Browse files
committed
Fix oci8 and pdo_oci
1 parent 853381d commit eaaab1c

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

src/scripts/ext/oci.sh

+14-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ add_license_log() {
99

1010
# Function to get the tag for a php version.
1111
get_tag() {
12-
master_version='8.0'
1312
tag='master'
14-
if [ ! "${version:?}" = "$master_version" ]; then
13+
if ! [[ ${version:?} =~ $nightly_versions ]]; then
1514
tag="php-$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')"
15+
elif [ "${version:?}" = '8.0' ]; then
16+
tag="PHP-8.0"
1617
fi
1718
echo "$tag"
1819
}
@@ -72,18 +73,23 @@ restore_phpize() {
7273

7374
# Function to patch pdo_oci.
7475
patch_pdo_oci_config() {
75-
curl -O "${curl_opts[@]}" https://raw.githubusercontent.com/php/php-src/master/ext/pdo_oci/config.m4
76-
sudo sed -i '' "/PHP_CHECK_PDO_INCLUDES/d" config.m4 || sudo sed -i "/PHP_CHECK_PDO_INCLUDES/d" config.m4
76+
curl -O "${curl_opts[@]}" https://raw.githubusercontent.com/php/php-src/PHP-8.0/ext/pdo_oci/config.m4
77+
if [[ ${version:?} =~ 5.[3-6] ]]; then
78+
sudo sed -i '' "/PHP_CHECK_PDO_INCLUDES/d" config.m4 2>/dev/null || sudo sed -i "/PHP_CHECK_PDO_INCLUDES/d" config.m4
79+
fi
7780
}
7881

7982
# Function to install the dependencies.
8083
add_dependencies() {
8184
if [ "$os" = 'Linux' ]; then
8285
if [ "${runner:?}" = "self-hosted" ]; then
83-
${apt_install:?} autoconf automake libaio-dev gcc g++ php"$version"-dev
86+
if ! [[ ${version:?} =~ $nightly_versions ]]; then
87+
${apt_install:?} --no-upgrade --no-install-recommends autoconf automake libaio-dev gcc g++ php"$version"-dev
88+
else
89+
${apt_install:?} --no-upgrade --no-install-recommends autoconf automake libaio-dev gcc g++
90+
fi
8491
else
85-
update_lists
86-
${apt_install:?} php"$version"-dev
92+
! [[ ${version:?} =~ $nightly_versions ]] && update_lists && ${apt_install:?} --no-upgrade --no-install-recommends php"$version"-dev
8793
fi
8894
sudo update-alternatives --set php-config /usr/bin/php-config"$version"
8995
sudo update-alternatives --set phpize /usr/bin/phpize"$version"
@@ -117,6 +123,7 @@ add_oci() {
117123
oracle_home='/opt/oracle'
118124
oracle_client=$oracle_home/instantclient
119125
os=$(uname -s)
126+
nightly_versions='8.[0-1]'
120127
add_client >/dev/null 2>&1
121128
add_dependencies >/dev/null 2>&1
122129
add_oci_helper >/dev/null 2>&1

0 commit comments

Comments
 (0)