From 4eebb5180f72d030a76d2f2c3a82cf1d24525816 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Wed, 6 Apr 2016 20:30:03 +0000 Subject: [PATCH] Make binary packages a namedtuple Signed-off-by: Niels Thykier --- britney.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/britney.py b/britney.py index a3caf0d..09e28be 100755 --- a/britney.py +++ b/britney.py @@ -188,7 +188,7 @@ import optparse import apt_pkg -from collections import defaultdict +from collections import defaultdict, namedtuple from functools import reduce from itertools import chain, product from operator import attrgetter @@ -227,6 +227,19 @@ check_field_name = dict((globals()[fn], fn) for fn in check_fields = sorted(check_field_name) +BinaryPackage = namedtuple('BinaryPackage', [ + 'version', + 'section', + 'source', + 'source_version', + 'architecture', + 'multi_arch', + 'depends', + 'conflicts', + 'provides', + 'is_essential', + ]) + class Britney(object): """Britney, the Debian testing updater script @@ -702,7 +715,7 @@ class Britney(object): else: provides = [] - dpkg = [version, + dpkg = BinaryPackage(version, intern(get_field('Section')), source, source_version, @@ -712,7 +725,7 @@ class Britney(object): ', '.join(final_conflicts_list) or None, provides, ess, - ] + ) # if the source package is available in the distribution, then register this binary package if source in srcdist: