mirror of
				https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
				synced 2025-11-04 10:34:05 +00:00 
			
		
		
		
	Assert that binaries have sensible arch values
Add a check to ensure we do not create broken test data (as happened recently, where the architecture values were swapped for a single binary). A cold hard failure like this is easier to debug compared to Britney playing "garbage in, garbage out". Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
		
							parent
							
								
									20c2b87833
								
							
						
					
					
						commit
						6360daf8c5
					
				@ -970,11 +970,16 @@ class Britney(object):
 | 
			
		||||
            else:
 | 
			
		||||
                provides = []
 | 
			
		||||
 | 
			
		||||
            raw_arch = intern(get_field('Architecture'))
 | 
			
		||||
            if raw_arch not in {'all', arch}:  # pragma: no cover
 | 
			
		||||
                raise AssertionError("%s has wrong architecture (%s) - should be either %s or all" % (
 | 
			
		||||
                    str(pkg_id), raw_arch, arch))
 | 
			
		||||
 | 
			
		||||
            dpkg = BinaryPackage(version,
 | 
			
		||||
                    intern(get_field('Section')),
 | 
			
		||||
                    source,
 | 
			
		||||
                    source_version,
 | 
			
		||||
                    intern(get_field('Architecture')),
 | 
			
		||||
                    raw_arch,
 | 
			
		||||
                    get_field('Multi-Arch'),
 | 
			
		||||
                    deps,
 | 
			
		||||
                    ', '.join(final_conflicts_list) or None,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user