britney: Skip architectures not listed in Release files

As a side effect, remove mips64el from NEW_ARCHES as we no longer need
that as a work around.

Closes: Debian/britney2#12
Signed-off-by: Niels Thykier <niels@thykier.net>
email-direct-upload-sponsor
Niels Thykier 8 years ago
parent 9bc94db01c
commit c86e1f7e9c

@ -37,7 +37,7 @@ OUTOFSYNC_ARCHES =
BREAK_ARCHES = BREAK_ARCHES =
# if you're in this list, you are a new architecture # if you're in this list, you are a new architecture
NEW_ARCHES = mips64el NEW_ARCHES =
# priorities and delays # priorities and delays
MINDAYS_LOW = 10 MINDAYS_LOW = 10

@ -207,7 +207,7 @@ from britney2.utils import (old_libraries_format, undo_changes,
write_excuses, write_heidi_delta, write_controlfiles, write_excuses, write_heidi_delta, write_controlfiles,
old_libraries, is_nuninst_asgood_generous, old_libraries, is_nuninst_asgood_generous,
clone_nuninst, check_installability, clone_nuninst, check_installability,
create_provides_map, create_provides_map, read_release_file,
) )
__author__ = 'Fabio Tranchitella and the Debian Release Team' __author__ = 'Fabio Tranchitella and the Debian Release Team'
@ -999,21 +999,21 @@ class Britney(object):
arch2packages = {} arch2packages = {}
if self.options.components: if self.options.components:
release_file = read_release_file(basedir)
listed_archs = set(release_file['Architectures'].split())
for arch in architectures: for arch in architectures:
packages = {} packages = {}
if arch not in listed_archs:
self.log("Skipping arch %s for %s: It is not listed in the Release file" % (arch, distribution))
arch2packages[arch] = ({}, {})
continue
for component in self.options.components: for component in self.options.components:
binary_dir = "binary-%s" % arch binary_dir = "binary-%s" % arch
filename = os.path.join(basedir, filename = os.path.join(basedir,
component, component,
binary_dir, binary_dir,
'Packages') 'Packages')
try:
filename = possibly_compressed(filename) filename = possibly_compressed(filename)
except FileNotFoundError:
if arch not in self.options.new_arches:
raise
self.log("Ignoring missing file for new arch %s: %s" % (arch, filename))
continue
udeb_filename = os.path.join(basedir, udeb_filename = os.path.join(basedir,
component, component,
"debian-installer", "debian-installer",

@ -21,6 +21,7 @@
# GNU General Public License for more details. # GNU General Public License for more details.
import apt_pkg
import errno import errno
import os import os
import time import time
@ -670,3 +671,18 @@ def create_provides_map(packages):
provides[provided_pkg].add((pkg, provided_version)) provides[provided_pkg].add((pkg, provided_version))
return provides return provides
def read_release_file(suite_dir):
"""Parses a given "Release" file
:param suite_dir: The directory to the suite
:return: A dict of the first (and only) paragraph in an Release file
"""
release_file = os.path.join(suite_dir, 'Release')
with open(release_file) as fd:
tag_file = iter(apt_pkg.TagFile(fd))
result = next(tag_file)
if next(tag_file, None) is not None:
raise TypeError("%s has more than one paragraph" % release_file)
return result

@ -37,7 +37,7 @@ OUTOFSYNC_ARCHES =
BREAK_ARCHES = BREAK_ARCHES =
# if you're in this list, you are a new architecture # if you're in this list, you are a new architecture
NEW_ARCHES = mips64el NEW_ARCHES =
# priorities and delays # priorities and delays
MINDAYS_LOW = 10 MINDAYS_LOW = 10

Loading…
Cancel
Save