Skip to content

Commit

Permalink
Fix logging/history for flatpak and cinnamon updates.
Browse files Browse the repository at this point in the history
Cinnamon's history file was moved in linuxmint/cinnamon@323b5aa3f.

We never wrote cinnamon or flatpak updates to the activity log
(Information menu item).

Fixes #859
  • Loading branch information
mtwebster committed Oct 7, 2024
1 parent bd5a64e commit f6a4d8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion usr/lib/linuxmint/mintUpdate/flatpak-update-worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ def start_updates(self):
def _execute_finished(self, task):
self.error = task.error_message
if task.error_message is not None:
self.write_to_log(task)
self.send_to_updater(f"error:{task.error_message}")
else:
self.send_to_updater("done")
self.write_to_log(task)
self.quit()

def write_to_log(self, task):
Expand Down
4 changes: 3 additions & 1 deletion usr/lib/linuxmint/mintUpdate/mintUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ def open_history(self, widget):
model.set_value(iter, COL_TYPE, _("package"))

if CINNAMON_SUPPORT:
logfile = '%s/.cinnamon/harvester.log' % os.path.expanduser("~")
logfile = os.path.join(GLib.get_user_state_dir(), 'cinnamon', 'harvester.log')
if os.path.isfile(logfile):
cinnamon_updates += subprocess.run('grep " upgrade " -sh %s' % logfile,
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, shell=True)\
Expand Down Expand Up @@ -2472,10 +2472,12 @@ def install(self, widget):
update = model.get_value(iter, UPDATE_OBJ)
if update.type == "cinnamon":
self.spices.append(update)
self.logger.write("Will install spice " + str(update.uuid))
iter = model.iter_next(iter)
continue
elif update.type == "flatpak":
self.flatpaks.append(update)
self.logger.write("Will install flatpak " + str(update.ref_name))
iter = model.iter_next(iter)
continue
if update.type == "kernel":
Expand Down

0 comments on commit f6a4d8b

Please sign in to comment.