another update for uninstallation process
This commit is contained in:
parent
04995241c4
commit
b16dffda4d
|
|
@ -92,6 +92,7 @@ LOG="Install-Logs/install-$(date +%d-%H%M%S)_hypr-pkgs.log"
|
||||||
# uninstalling conflicting packages
|
# uninstalling conflicting packages
|
||||||
# Initialize a variable to track overall errors
|
# Initialize a variable to track overall errors
|
||||||
overall_failed=0
|
overall_failed=0
|
||||||
|
|
||||||
printf "\n%s - Removing Mako, Dunst, and rofi as they conflict with swaync and rofi-wayland \n" "${NOTE}"
|
printf "\n%s - Removing Mako, Dunst, and rofi as they conflict with swaync and rofi-wayland \n" "${NOTE}"
|
||||||
for PKG in "${uninstall[@]}"; do
|
for PKG in "${uninstall[@]}"; do
|
||||||
uninstall_package "$PKG" 2>&1 | tee -a "$LOG"
|
uninstall_package "$PKG" 2>&1 | tee -a "$LOG"
|
||||||
|
|
@ -101,7 +102,6 @@ for PKG in "${uninstall[@]}"; do
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Report if any uninstallation failed, but do not exit the script
|
|
||||||
if [ $overall_failed -ne 0 ]; then
|
if [ $overall_failed -ne 0 ]; then
|
||||||
echo -e "${ERROR} Some packages failed to uninstall. Please check the log."
|
echo -e "${ERROR} Some packages failed to uninstall. Please check the log."
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -71,16 +71,15 @@ uninstall_package() {
|
||||||
if pacman -Qi "$pkg" &>> /dev/null ; then
|
if pacman -Qi "$pkg" &>> /dev/null ; then
|
||||||
# Package is installed
|
# Package is installed
|
||||||
echo -e "${NOTE} Uninstalling $pkg ..."
|
echo -e "${NOTE} Uninstalling $pkg ..."
|
||||||
sudo pacman -R --noconfirm "$pkg" 2>&1 | grep -v "error: target not found" | tee -a "$LOG"
|
sudo pacman -R --noconfirm "$pkg" 2>&1 | tee -a "$LOG" | grep -v "error: target not found"
|
||||||
# Making sure package is uninstalled
|
# Check if the package was uninstalled
|
||||||
if ! pacman -Qi "$pkg" &>> /dev/null ; then
|
if ! pacman -Qi "$pkg" &>> /dev/null ; then
|
||||||
echo -e "\e[1A\e[K${OK} $pkg was uninstalled."
|
echo -e "\e[1A\e[K${OK} $pkg was uninstalled."
|
||||||
else
|
else
|
||||||
# Log the failure but continue
|
|
||||||
echo -e "\e[1A\e[K${ERROR} $pkg failed to uninstall. Please check the log."
|
echo -e "\e[1A\e[K${ERROR} $pkg failed to uninstall. Please check the log."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else # Package is not installed
|
else
|
||||||
echo -e "${NOTE} $pkg is not installed, skipping uninstallation."
|
echo -e "${NOTE} $pkg is not installed, skipping uninstallation."
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue