Skip to content

Commit

Permalink
dom0 fix updating
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrbartman committed Mar 26, 2024
1 parent 089f2f4 commit 9c36fe9
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions qui/updater/progress_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,22 @@ def update_admin_vm(self, admins):
curr_pkg = self._get_packages_admin()

# pylint: disable=consider-using-with
check_updates = subprocess.Popen(
['sudo', 'qubes-dom0-update', '--refresh', '--check-only'],
stderr=subprocess.PIPE, stdout=subprocess.PIPE)
_stdout, stderr = check_updates.communicate()
if check_updates.returncode != 100:
GLib.idle_add(admin.append_text_view, stderr)
if check_updates.returncode != 0:
GLib.idle_add(admin.set_status, UpdateStatus.Error)
else:
GLib.idle_add(
admin.set_status, UpdateStatus.NoUpdatesFound)
self.update_details.update_buffer()
return

proc = subprocess.Popen(
['sudo', 'qubes-dom0-update'],
['sudo', 'qubes-dom0-update', '-y'],
stderr=subprocess.PIPE, stdout=subprocess.PIPE)

read_err_thread = threading.Thread(
Expand Down Expand Up @@ -189,10 +203,7 @@ def update_admin_vm(self, admins):
changes_str = self._print_changes(changes)
GLib.idle_add(admin.append_text_view, changes_str)

if "No updates available" in admin.buffer:
GLib.idle_add(admin.set_status, UpdateStatus.NoUpdatesFound)
else:
GLib.idle_add(admin.set_status, UpdateStatus.Success)
GLib.idle_add(admin.set_status, UpdateStatus.Success)
except subprocess.CalledProcessError as ex:
GLib.idle_add(
admin.append_text_view,
Expand Down

0 comments on commit 9c36fe9

Please sign in to comment.