mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Improve regexes for pre-release extensions
This commit is contained in:
parent
5865982519
commit
fa211a9d07
@ -43,7 +43,7 @@ pecl_install() {
|
||||
# Function to get the PECL version
|
||||
get_pecl_version() {
|
||||
extension=$1
|
||||
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")"
|
||||
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot|preview)")"
|
||||
pecl_rest='https://pecl.php.net/rest/r/'
|
||||
response=$(curl "${curl_opts[@]}" "$pecl_rest$extension"/allreleases.xml)
|
||||
pecl_version=$(echo "$response" | grep -m 1 -Eio "(\d*\.\d*\.\d*$stability\d*)")
|
||||
@ -58,7 +58,7 @@ add_pecl_extension() {
|
||||
extension=$1
|
||||
pecl_version=$2
|
||||
prefix=$3
|
||||
if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot).* ]]; then
|
||||
if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot|preview).* ]]; then
|
||||
pecl_version=$(get_pecl_version "$extension" "$pecl_version")
|
||||
fi
|
||||
if ! check_extension "$extension" && [ -e "$ext_dir/$extension.so" ]; then
|
||||
|
@ -49,7 +49,7 @@ configure_pecl() {
|
||||
# Function to get the PECL version
|
||||
get_pecl_version() {
|
||||
extension=$1
|
||||
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot)")"
|
||||
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot|preview)")"
|
||||
pecl_rest='https://pecl.php.net/rest/r/'
|
||||
response=$(curl "${curl_opts[@]}" "$pecl_rest$extension"/allreleases.xml)
|
||||
pecl_version=$(echo "$response" | grep -m 1 -Pio "(\d*\.\d*\.\d*$stability\d*)")
|
||||
@ -120,7 +120,7 @@ add_pecl_extension() {
|
||||
extension=$1
|
||||
pecl_version=$2
|
||||
prefix=$3
|
||||
if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot).* ]]; then
|
||||
if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot|preview).* ]]; then
|
||||
pecl_version=$(get_pecl_version "$extension" "$pecl_version")
|
||||
fi
|
||||
if ! check_extension "$extension" && [ -e "$ext_dir/$extension.so" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user