mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 21:33:06 +07:00
Fix updating lists in phalcon setup on Ubuntu
This commit is contained in:
parent
84f23853b7
commit
90b6355bf0
@ -10,11 +10,24 @@ add_log() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to update php ppa
|
# Function to add ppa:ondrej/php
|
||||||
update_ppa() {
|
add_ppa() {
|
||||||
if [ "$ppa_updated" = "false" ]; then
|
if ! apt-cache policy | grep -q ondrej/php; then
|
||||||
find /etc/apt/sources.list.d -type f -name 'ondrej-ubuntu-php*.list' -exec sudo DEBIAN_FRONTEND=noninteractive apt-get update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1
|
cleanup_lists
|
||||||
ppa_updated="true"
|
LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y
|
||||||
|
if [ "$DISTRIB_RELEASE" = "16.04" ]; then
|
||||||
|
sudo "$debconf_fix" apt-get update
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Function to update the package lists
|
||||||
|
update_lists() {
|
||||||
|
if [ ! -e /tmp/setup_php ]; then
|
||||||
|
[ "$DISTRIB_RELEASE" = "20.04" ] && add_ppa >/dev/null 2>&1
|
||||||
|
cleanup_lists
|
||||||
|
sudo "$debconf_fix" apt-get update >/dev/null 2>&1
|
||||||
|
echo '' | sudo tee "/tmp/setup_php" >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -26,11 +39,11 @@ install_phalcon() {
|
|||||||
add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
|
add_log "$cross" "$extension" "Could not install $extension on PHP $semver"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
debconf_fix="DEBIAN_FRONTEND=noninteractive"
|
||||||
ini_file="/etc/php/$2/cli/conf.d/50-phalcon.ini"
|
ini_file="/etc/php/$2/cli/conf.d/50-phalcon.ini"
|
||||||
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
||||||
semver=$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')
|
semver=$(php -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-')
|
||||||
extension_major_version=$(echo "$1" | grep -i -Po '\d')
|
extension_major_version=$(echo "$1" | grep -i -Po '\d')
|
||||||
ppa_updated="false"
|
|
||||||
tick="✓"
|
tick="✓"
|
||||||
cross="✗"
|
cross="✗"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user