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>
email-direct-upload-sponsor
Niels Thykier 8 years ago
parent 20c2b87833
commit 6360daf8c5

@ -970,11 +970,16 @@ class Britney(object):
else: else:
provides = [] 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, dpkg = BinaryPackage(version,
intern(get_field('Section')), intern(get_field('Section')),
source, source,
source_version, source_version,
intern(get_field('Architecture')), raw_arch,
get_field('Multi-Arch'), get_field('Multi-Arch'),
deps, deps,
', '.join(final_conflicts_list) or None, ', '.join(final_conflicts_list) or None,

Loading…
Cancel
Save