add missing check for flatpak

This commit is contained in:
AustrianToast 2024-07-07 02:17:51 +02:00
parent a8eee49762
commit e86a004a28
Signed by: AustrianToast
GPG Key ID: 378A29F999424B1C

5
update
View File

@ -79,7 +79,7 @@ before_backup() {
mkdir --parents "$TMP"/before-backup_"$DATE" "$TMP"/after-backup_"$DATE" mkdir --parents "$TMP"/before-backup_"$DATE" "$TMP"/after-backup_"$DATE"
pacman --verbose --query > "$TMP"/before-backup_"$DATE"/pacman-before.txt pacman --verbose --query > "$TMP"/before-backup_"$DATE"/pacman-before.txt
[[ -f /usr/bin/flatpak ]] && flatpak list --all --show-details > "$TMP"/before-backup_"$DATE"/flatpak-before.txt [[ -x /usr/bin/flatpak ]] && flatpak list --all --show-details > "$TMP"/before-backup_"$DATE"/flatpak-before.txt
tar --create --zstd --file "$TMP"/before-backup_"$DATE".tar.zst.new "$TMP"/before-backup_"$DATE" /var/lib/pacman/local > /dev/null 2>&1 # for some reason it needs the output suppresion tar --create --zstd --file "$TMP"/before-backup_"$DATE".tar.zst.new "$TMP"/before-backup_"$DATE" /var/lib/pacman/local > /dev/null 2>&1 # for some reason it needs the output suppresion
mv "$TMP"/before-backup_"$DATE".tar.zst.new "$BACKUP_LOCATION" mv "$TMP"/before-backup_"$DATE".tar.zst.new "$BACKUP_LOCATION"
@ -90,7 +90,7 @@ before_backup() {
after_backup() { after_backup() {
pacman --verbose --query > "$TMP"/after-backup_"$DATE"/pacman-after.txt pacman --verbose --query > "$TMP"/after-backup_"$DATE"/pacman-after.txt
flatpak list --all --show-details > "$TMP"/after-backup_"$DATE"/flatpak-after.txt [[ -x /usr/bin/flatpak ]] && flatpak list --all --show-details > "$TMP"/after-backup_"$DATE"/flatpak-after.txt
tar --create --zstd --file "$TMP"/after-backup_"$DATE".tar.zst.new "$TMP"/after-backup_"$DATE" > /dev/null 2>&1 tar --create --zstd --file "$TMP"/after-backup_"$DATE".tar.zst.new "$TMP"/after-backup_"$DATE" > /dev/null 2>&1
mv "$TMP"/after-backup_"$DATE".tar.zst.new "$BACKUP_LOCATION" mv "$TMP"/after-backup_"$DATE".tar.zst.new "$BACKUP_LOCATION"
@ -128,6 +128,7 @@ if [[ ${1:0:2} == \-\- ]]; then
before_backup before_backup
delete_oldest_backup before-backup delete_oldest_backup before-backup
mv "$BACKUP_LOCATION"/before-backup_"$DATE".tar.zst.new "$BACKUP_LOCATION"/before-backup_"$DATE".tar.zst mv "$BACKUP_LOCATION"/before-backup_"$DATE".tar.zst.new "$BACKUP_LOCATION"/before-backup_"$DATE".tar.zst
[[ $SECONDARY_BACKUP_LOCATION ]] && mv "$SECONDARY_BACKUP_LOCATION"/before-backup_"$DATE".tar.zst.new "$SECONDARY_BACKUP_LOCATION"/before-backup_"$DATE".tar.zst
rm --recursive --force "$TMP" ;; rm --recursive --force "$TMP" ;;
?) ?)
help; exit 1;; help; exit 1;;