mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-10-31 00:24:06 +00:00 
			
		
		
		
	Optimize out "nvirtual" member of undo items
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
		
							parent
							
								
									5642a90449
								
							
						
					
					
						commit
						59ae7e3d68
					
				| @ -227,7 +227,7 @@ class MigrationManager(object): | |||||||
|         affected by the change (as (name, arch)-tuples) and the |         affected by the change (as (name, arch)-tuples) and the | ||||||
|         dictionary undo which can be used to rollback the changes. |         dictionary undo which can be used to rollback the changes. | ||||||
|         """ |         """ | ||||||
|         undo = {'binaries': {}, 'sources': {}, 'virtual': {}, 'nvirtual': []} |         undo = {'binaries': {}, 'sources': {}, 'virtual': {}} | ||||||
| 
 | 
 | ||||||
|         affected_direct = set() |         affected_direct = set() | ||||||
|         updated_binaries = set() |         updated_binaries = set() | ||||||
| @ -338,11 +338,9 @@ class MigrationManager(object): | |||||||
|                 # register new provided packages |                 # register new provided packages | ||||||
|                 for provided_pkg, prov_version, _ in new_pkg_data.provides: |                 for provided_pkg, prov_version, _ in new_pkg_data.provides: | ||||||
|                     key = (provided_pkg, parch) |                     key = (provided_pkg, parch) | ||||||
|                     if provided_pkg not in provides_t_a: |                     if key not in undo['virtual']: | ||||||
|                         undo['nvirtual'].append(key) |                         restore_as = provides_t_a[provided_pkg].copy() if provided_pkg in provides_t_a else None | ||||||
|                         provides_t_a[provided_pkg] = set() |                         undo['virtual'][key] = restore_as | ||||||
|                     elif key not in undo['virtual']: |  | ||||||
|                         undo['virtual'][key] = provides_t_a[provided_pkg].copy() |  | ||||||
|                     provides_t_a[provided_pkg].add((binary, prov_version)) |                     provides_t_a[provided_pkg].add((binary, prov_version)) | ||||||
|                 if not equivalent_replacement: |                 if not equivalent_replacement: | ||||||
|                     # all the reverse dependencies are affected by the change |                     # all the reverse dependencies are affected by the change | ||||||
|  | |||||||
| @ -100,12 +100,13 @@ class MigrationTransactionState(object): | |||||||
| 
 | 
 | ||||||
|         # STEP 4 |         # STEP 4 | ||||||
|         # undo all changes to virtual packages |         # undo all changes to virtual packages | ||||||
|         for (undo, updated_binaries) in lundo: |         for (undo, _) in lundo: | ||||||
|             for provided_pkg, arch in undo['nvirtual']: |             for p, value in undo['virtual'].items(): | ||||||
|                 del provides_t[arch][provided_pkg] |  | ||||||
|             for p in undo['virtual']: |  | ||||||
|                 provided_pkg, arch = p |                 provided_pkg, arch = p | ||||||
|                 provides_t[arch][provided_pkg] = undo['virtual'][p] |                 if value is None: | ||||||
|  |                     del provides_t[arch][provided_pkg] | ||||||
|  |                 else: | ||||||
|  |                     provides_t[arch][provided_pkg] = undo['virtual'][p] | ||||||
| 
 | 
 | ||||||
|     @property |     @property | ||||||
|     def is_rolled_back(self): |     def is_rolled_back(self): | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user