From 180eb8f7b6968d2b41e2f9047da33027b64f7e42 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Mon, 18 Dec 2023 01:23:02 -0800 Subject: [PATCH] Revert "fix(flatpak-manager): Don't install packages that are already present or remove packages that aren't there" This reverts commit 9deec489a03b111be993eafcdccd38234fce158f. --- .../shared/usr/bin/bazzite-flatpak-manager | 26 +++++++------------ 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager b/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager index 3eb72624..19f2f4be 100755 --- a/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager +++ b/system_files/desktop/shared/usr/bin/bazzite-flatpak-manager @@ -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