Fix upgrading nightly versions

This commit is contained in:
Shivam Mathur 2021-11-18 19:40:47 +05:30
parent 721e4c3367
commit 2f5c2edb22
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -137,13 +137,13 @@ add_packaged_php() {
# Function to update PHP.
update_php() {
initial_version=$(php_semver)
add_packaged_php
updated_version=$(php_semver)
initial_version="$(php_semver)$(php_extra_version)"
add_php
updated_version="$(php_semver)$(php_extra_version)"
if [ "$updated_version" != "$initial_version" ]; then
status="Updated to"
else
status="Switched to"
status="Found"
fi
}
@ -155,6 +155,7 @@ add_php() {
setup_old_versions
else
add_packaged_php
switch_version >/dev/null 2>&1
fi
status="Installed"
}
@ -183,15 +184,15 @@ setup_php() {
if [ ! -e "/usr/bin/php$version" ]; then
add_php >/dev/null 2>&1
else
if ! [[ "$version" =~ ${old_versions:?} ]]; then
switch_version >/dev/null 2>&1
fi
if [ "${update:?}" = "true" ]; then
update_php >/dev/null 2>&1
else
status="Switched to"
fi
fi
if ! [[ "$version" =~ ${old_versions:?}|${nightly_versions:?} ]]; then
switch_version >/dev/null 2>&1
fi
else
if [ "$update" = "true" ]; then
update_php >/dev/null 2>&1