@@ -419,6 +419,7 @@ def __init__(self, task):
419
419
self .transaction .connect ("operation-done" , self ._operation_done )
420
420
self .transaction .connect ("operation-error" , self ._operation_error )
421
421
self .transaction .connect ("add-new-remote" , self ._transaction_add_new_remote )
422
+ self .transaction .connect ("end-of-lifed" , self ._ref_eoled )
422
423
self .transaction .connect ("end-of-lifed-with-rebase" , self ._ref_eoled_with_rebase )
423
424
424
425
# 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
678
679
debug ("Adding new remote '%s' (%s) for %s: %s" % (suggested_remote_name , url , from_id , reason ))
679
680
return True
680
681
682
+ def _ref_eoled (self , transaction , ref , reason , rebase ):
683
+ warn ("%s is end-of-life (EOL) (%s)" % (ref , reason ))
684
+
681
685
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 ))
683
687
684
688
try :
685
689
transaction .add_uninstall (ref )
686
690
except :
687
691
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
693
700
694
701
return True
695
702
0 commit comments