mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 10:34:05 +00:00 
			
		
		
		
	do_all: Simplify the assignments to a variable
At a glance, it looks like the value of "better" variable can be decided from 3-4 places. However, due to the code flow only two of those assignments are truly "live"/useful. Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
		
							parent
							
								
									ba74012678
								
							
						
					
					
						commit
						9030ff4d99
					
				
							
								
								
									
										17
									
								
								britney.py
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								britney.py
									
									
									
									
									
								
							@ -2281,7 +2281,6 @@ class Britney(object):
 | 
			
		||||
        recurse = True
 | 
			
		||||
        lundo = None
 | 
			
		||||
        nuninst_end = None
 | 
			
		||||
        better = True
 | 
			
		||||
        extra = []
 | 
			
		||||
 | 
			
		||||
        if hinttype == "easy" or hinttype == "force-hint":
 | 
			
		||||
@ -2306,13 +2305,10 @@ class Britney(object):
 | 
			
		||||
 | 
			
		||||
        if init:
 | 
			
		||||
            # init => a hint (e.g. "easy") - so do the hint run
 | 
			
		||||
            (better, nuninst_end, undo_list, _) = self.try_migration(selected,
 | 
			
		||||
                                                                     self.nuninst_orig,
 | 
			
		||||
                                                                     lundo=lundo,
 | 
			
		||||
                                                                     automatic_revert=False)
 | 
			
		||||
            if force:
 | 
			
		||||
                # Force implies "unconditionally better"
 | 
			
		||||
                better = True
 | 
			
		||||
            (_, nuninst_end, undo_list, _) = self.try_migration(selected,
 | 
			
		||||
                                                                self.nuninst_orig,
 | 
			
		||||
                                                                lundo=lundo,
 | 
			
		||||
                                                                automatic_revert=False)
 | 
			
		||||
 | 
			
		||||
            if lundo is not None:
 | 
			
		||||
                lundo.extend(undo_list)
 | 
			
		||||
@ -2338,7 +2334,10 @@ class Britney(object):
 | 
			
		||||
                self.output_write(eval_uninst(self.options.architectures,
 | 
			
		||||
                                              newly_uninst(nuninst_start, nuninst_end)))
 | 
			
		||||
 | 
			
		||||
        if not force:
 | 
			
		||||
        if force:
 | 
			
		||||
            # Force implies "unconditionally better"
 | 
			
		||||
            better = True
 | 
			
		||||
        else:
 | 
			
		||||
            break_arches = set(self.options.break_arches)
 | 
			
		||||
            if all(x.architecture in break_arches for x in selected):
 | 
			
		||||
                # If we only migrated items from break-arches, then we
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user