From 6dba529f13ee5f16811f0b9dea63c516800684bd Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 4 Jun 2021 21:28:54 +0530 Subject: [PATCH] Fix extension setup --- src/scripts/common.sh | 5 ++--- src/scripts/linux.sh | 5 +---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/scripts/common.sh b/src/scripts/common.sh index 091587b6..ebc537db 100644 --- a/src/scripts/common.sh +++ b/src/scripts/common.sh @@ -126,9 +126,8 @@ enable_cache_extension() { # Function to enable existing extensions. enable_extension() { - if [ -e /tmp/setup_php_dismod ] && grep -q "$1" /tmp/setup_php_dismod; then - sudo phpenmod -v "$version" "$1" >/dev/null 2>&1 - fi + modules_dir="/var/lib/php/modules/$version" + [ -d "$modules_dir" ] && sudo find "$modules_dir" -path "*disabled*$1" -delete if [ -d /tmp/extcache/"$1" ]; then enable_cache_extension "$1" "$2" elif ! check_extension "$1" && [ -e "${ext_dir:?}/$1.so" ]; then diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 7f981e80..2af9862b 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -57,9 +57,7 @@ delete_extension() { extension=$1 disable_extension "$extension" sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1 - if [ "${runner:?}" = "self-hosted" ]; then - $apt_remove "php-$extension" "php$version-$extension" >/dev/null 2>&1 || true - fi + sudo sed -i "/Package: php$version-$extension/,/^$/d" /var/lib/dpkg/status } # Function to disable and delete extensions. @@ -68,7 +66,6 @@ remove_extension() { if check_extension "$extension"; then if [[ ! "$version" =~ ${old_versions:?} ]] && [ -e /etc/php/"$version"/mods-available/"$extension".ini ]; then sudo phpdismod -v "$version" "$extension" >/dev/null 2>&1 - echo "$extension" | sudo tee -a /tmp/setup_php_dismod >/dev/null 2>&1 fi delete_extension "$extension" (! check_extension "$extension" && add_log "${tick:?}" ":$extension" "Removed") ||