Revert "fix(flatpak-manager): Don't install packages that are already present or remove packages that aren't there"

This reverts commit 9deec489a0.
This commit is contained in:
Kyle Gospodnetich 2023-12-18 01:23:02 -08:00
parent f5f5329e35
commit 180eb8f7b6

View File

@ -21,30 +21,22 @@ fi
# Ensure Flathub is enabled
flatpak remote-modify --system --enable flathub
# Installed flatpaks
# Lists of flatpaks
FLATPAK_LIST=$(flatpak list --columns=application)
# Flatpak list files
INSTALL_LIST_FILE="/usr/share/ublue-os/bazzite/flatpak/install"
REMOVE_LIST_FILE="/usr/share/ublue-os/bazzite/flatpak/remove"
INSTALL_LIST=$(cat /usr/share/ublue-os/bazzite/flatpak/install)
REMOVE_LIST=$(cat /usr/share/ublue-os/bazzite/flatpak/remove)
# Install flatpaks in list
if [[ -f $INSTALL_LIST_FILE ]]; then
INSTALL_LIST=$(echo $FLATPAK_LIST | grep -vf - $INSTALL_LIST_FILE)
if [[ -n $INSTALL_LIST ]]; then
if ! flatpak install --system --noninteractive flathub ${INSTALL_LIST[@]}; then
# exit on error
exit 1
fi
if [[ -n $INSTALL_LIST ]]; then
if ! flatpak install --system --noninteractive flathub ${INSTALL_LIST[@]}; then
# exit on error
exit 1
fi
fi
# Remove flatpaks in list once
if [[ ! -f $VER_FILE && -f $REMOVE_LIST_FILE ]]; then
REMOVE_LIST=$(echo $FLATPAK_LIST | grep -f - $REMOVE_LIST_FILE)
if [[ -n $REMOVE_LIST ]]; then
flatpak remove --system --noninteractive ${REMOVE_LIST[@]}
fi
if [[ ! -f $VER_FILE && -n $REMOVE_LIST ]]; then
flatpak remove --system --noninteractive ${REMOVE_LIST[@]}
fi
mkdir -p /etc/bazzite