Improve updating lists

This commit is contained in:
Shivam Mathur 2020-07-20 17:20:16 +05:30
parent 5b2e081bc0
commit 19497a0597
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -29,6 +29,7 @@ cleanup_lists() {
# Function to update php ppa # Function to update php ppa
update_lists() { update_lists() {
if [ "$lists_updated" = "false" ]; then if [ "$lists_updated" = "false" ]; then
cleanup_lists
sudo "$debconf_fix" apt-get update >/dev/null 2>&1 sudo "$debconf_fix" apt-get update >/dev/null 2>&1
fi fi
} }
@ -262,7 +263,10 @@ step_log "Setup PHP"
sudo mkdir -p /var/run /run/php sudo mkdir -p /var/run /run/php
. /etc/lsb-release . /etc/lsb-release
if [ "$DISTRIB_RELEASE" = "20.04" ]; then if [ "$DISTRIB_RELEASE" = "20.04" ]; then
LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y if ! apt-cache policy | grep -q ondrej/php; then
cleanup_lists
LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y
fi
fi fi
if [ "$existing_version" != "$version" ]; then if [ "$existing_version" != "$version" ]; then