Make binary packages a namedtuple

Signed-off-by: Niels Thykier <niels@thykier.net>
master
Niels Thykier 8 years ago
parent 7230cd29c0
commit 4eebb5180f

@ -188,7 +188,7 @@ import optparse
import apt_pkg import apt_pkg
from collections import defaultdict from collections import defaultdict, namedtuple
from functools import reduce from functools import reduce
from itertools import chain, product from itertools import chain, product
from operator import attrgetter from operator import attrgetter
@ -227,6 +227,19 @@ check_field_name = dict((globals()[fn], fn) for fn in
check_fields = sorted(check_field_name) 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): class Britney(object):
"""Britney, the Debian testing updater script """Britney, the Debian testing updater script
@ -702,7 +715,7 @@ class Britney(object):
else: else:
provides = [] provides = []
dpkg = [version, dpkg = BinaryPackage(version,
intern(get_field('Section')), intern(get_field('Section')),
source, source,
source_version, source_version,
@ -712,7 +725,7 @@ class Britney(object):
', '.join(final_conflicts_list) or None, ', '.join(final_conflicts_list) or None,
provides, provides,
ess, ess,
] )
# if the source package is available in the distribution, then register this binary package # if the source package is available in the distribution, then register this binary package
if source in srcdist: if source in srcdist:

Loading…
Cancel
Save