mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 02:24:24 +00:00 
			
		
		
		
	Include old cruft items directly in upgrade_me
This enables us to remove the recursion in iter_packages (and thereby the added noise from it). As a side-effect of this change, the solver can now solve the "left-binary-removal" test case as it can see the relevant cruft item together with the regular items needed to solve the migration. Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
		
							parent
							
								
									5d408fa800
								
							
						
					
					
						commit
						98d4553185
					
				
							
								
								
									
										15
									
								
								britney.py
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								britney.py
									
									
									
									
									
								
							@ -289,6 +289,7 @@ class Britney(object):
 | 
			
		||||
 | 
			
		||||
        self.all_selected = []
 | 
			
		||||
        self.excuses = {}
 | 
			
		||||
        self.upgrade_me = []
 | 
			
		||||
 | 
			
		||||
        if self.options.nuninst_cache:
 | 
			
		||||
            self.logger.info("Not building the list of non-installable packages, as requested")
 | 
			
		||||
@ -1378,6 +1379,7 @@ class Britney(object):
 | 
			
		||||
        # sort the list of candidates
 | 
			
		||||
        mi_factory = self._migration_item_factory
 | 
			
		||||
        self.upgrade_me = sorted(mi_factory.parse_item(x, versioned=False, auto_correct=False) for x in upgrade_me)
 | 
			
		||||
        self.upgrade_me.extend(old_libraries(mi_factory, self.suite_info, self.options.outofsync_arches))
 | 
			
		||||
 | 
			
		||||
        # write excuses to the output file
 | 
			
		||||
        if not self.options.dry_run:
 | 
			
		||||
@ -1425,7 +1427,7 @@ class Britney(object):
 | 
			
		||||
            res.append("%s-%d" % (arch[0], n))
 | 
			
		||||
        return "%d+%d: %s" % (total, totalbreak, ":".join(res))
 | 
			
		||||
 | 
			
		||||
    def iter_packages(self, packages, selected, nuninst=None, try_removals=True):
 | 
			
		||||
    def iter_packages(self, packages, selected, nuninst=None):
 | 
			
		||||
        """Iter on the list of actions and apply them one-by-one
 | 
			
		||||
 | 
			
		||||
        This method applies the changes from `packages` to testing, checking the uninstallability
 | 
			
		||||
@ -1538,17 +1540,6 @@ class Britney(object):
 | 
			
		||||
                        else:
 | 
			
		||||
                            maybe_rescheduled_packages.append(comp[0])
 | 
			
		||||
 | 
			
		||||
        if try_removals and self.options.smooth_updates:
 | 
			
		||||
            self.logger.info("> Removing old packages left in the target suite from smooth updates")
 | 
			
		||||
            removals = old_libraries(self._migration_item_factory, self.suite_info, self.options.outofsync_arches)
 | 
			
		||||
            if removals:
 | 
			
		||||
                output_logger.info("Removing packages left in the target suite for smooth updates (%d):", len(removals))
 | 
			
		||||
                log_and_format_old_libraries(self.output_logger, removals)
 | 
			
		||||
                (nuninst_last_accepted, extra) = self.iter_packages(removals,
 | 
			
		||||
                                                                    selected,
 | 
			
		||||
                                                                    nuninst=nuninst_last_accepted,
 | 
			
		||||
                                                                    try_removals=False)
 | 
			
		||||
 | 
			
		||||
        output_logger.info(" finish: [%s]", ",".join(x.uvname for x in selected))
 | 
			
		||||
        output_logger.info("endloop: %s", self.eval_nuninst(self.nuninst_orig))
 | 
			
		||||
        output_logger.info("    now: %s", self.eval_nuninst(nuninst_last_accepted))
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user