fix: Improve flatpak update check logic

This commit is contained in:
Hannes
2026-08-24 14:07:09 +02:00
parent 7a1e432231
commit deb879b6c4
+14 -6
View File
@@ -301,20 +301,28 @@ function updateall
set -l flatpak_status "skipped"
set -l flatpak_color yellow
if type -q flatpak and type -q timeout
set -l flatpak_has_updates 0
set -l flatpak_check (timeout 5s flatpak remote-ls --updates 2>&1)
set -l flatpak_tmp (mktemp)
timeout 5s flatpak remote-ls --updates >$flatpak_tmp 2>&1
set -l flatpak_check_code $status
set -l flatpak_check (cat $flatpak_tmp)
rm $flatpak_tmp
if test $flatpak_check_code -eq 0
if test -z "$flatpak_check" # do not know why it works should maybe be test -n "$flatpak_check" instead of test -z "$flatpak_check"
if test -n "$flatpak_check" # do not know why it works should maybe be test -n "$flatpak_check" instead of test -z "$flatpak_check"
set flatpak_has_updates 1
end
else if test $flatpak_check_code -eq 1
echo "flatpak: no updates available"
else if test $flatpak_check_code -eq 124
set flatpak_has_updates 2
else
set flatpak_has_updates 0
end
if test $flatpak_has_updates -eq 1
if test $flatpak_has_updates -eq 2
echo "flatpak: update check failed"
set flatpak_status "update check failed"
set flatpak_color red
else if test $flatpak_has_updates -eq 1
echo "flatpak: up to date"
set flatpak_status "up to date"
set flatpak_color green