Skip to content

Commit 8ddcdd2

Browse files
committed
_flatpak.py: Fix end-of-lifed-with-rebase handling.
This was only marking the eol'd package for removal, but would fail to add a replacement, as the arguments for add_rebase() were incorrect.
1 parent 1fb5734 commit 8ddcdd2

File tree

1 file changed

+13
-6
lines changed
  • usr/lib/python3/dist-packages/mintcommon/installer

1 file changed

+13
-6
lines changed

usr/lib/python3/dist-packages/mintcommon/installer/_flatpak.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,7 @@ def __init__(self, task):
419419
self.transaction.connect("operation-done", self._operation_done)
420420
self.transaction.connect("operation-error", self._operation_error)
421421
self.transaction.connect("add-new-remote", self._transaction_add_new_remote)
422+
self.transaction.connect("end-of-lifed", self._ref_eoled)
422423
self.transaction.connect("end-of-lifed-with-rebase", self._ref_eoled_with_rebase)
423424

424425
# Runtimes explicitly installed are 'pinned' - which means they'll never be automatically
@@ -678,18 +679,24 @@ def _transaction_add_new_remote(self, transaction, reason_code, from_id, suggest
678679
debug("Adding new remote '%s' (%s) for %s: %s" % (suggested_remote_name, url, from_id, reason))
679680
return True
680681

682+
def _ref_eoled(self, transaction, ref, reason, rebase):
683+
warn("%s is end-of-life (EOL) (%s)" % (ref, reason))
684+
681685
def _ref_eoled_with_rebase(self, transaction, remote, ref, reason, rebased_to_ref, prev_ids):
682-
warn("%s is EOL (%s). Replacing with %s" % (ref, reason, rebased_to_ref))
686+
warn("%s is end-of-life (EOL) (%s)" % (ref, reason))
683687

684688
try:
685689
transaction.add_uninstall(ref)
686690
except:
687691
pass
688-
try:
689-
transaction.add_rebase(rebased_to_ref)
690-
except:
691-
debug("No new ref to rebase to, using the eol'd one")
692-
return False
692+
693+
if rebased_to_ref is not None:
694+
try:
695+
warn("Replacing with %s" % rebased_to_ref)
696+
transaction.add_rebase(remote, rebased_to_ref, None, prev_ids)
697+
except GLib.Error as e:
698+
debug("Problem adding replacement ref: %s" % e.message)
699+
return False
693700

694701
return True
695702

0 commit comments

Comments
 (0)