Defer loading and registering of hints

Signed-off-by: Niels Thykier <niels@thykier.net>
ubuntu/rebased
Niels Thykier 6 years ago
parent e52d46a84d
commit 584f75bbc0
No known key found for this signature in database
GPG Key ID: A65B78DBE67C7AAC

@ -292,11 +292,6 @@ class Britney(object):
self.all_selected = []
self.excuses = {}
try:
self.read_hints(self.options.hintsdir)
except AttributeError:
self.read_hints(os.path.join(self.suite_info['unstable'].path, 'Hints'))
if self.options.nuninst_cache:
self.logger.info("Not building the list of non-installable packages, as requested")
if self.options.print_uninst:
@ -371,6 +366,14 @@ class Britney(object):
# nuninst_orig may get updated during the upgrade process
self.nuninst_orig_save = clone_nuninst(self.nuninst_orig, architectures=self.options.architectures)
for policy in self.policies:
policy.register_hints(self._hint_parser)
try:
self.read_hints(self.options.hintsdir)
except AttributeError:
self.read_hints(os.path.join(self.suite_info['unstable'].path, 'Hints'))
for policy in self.policies:
policy.hints = self.hints
policy.initialise(self)
@ -496,9 +499,6 @@ class Britney(object):
self.policies.append(AgePolicy(self.options, self.suite_info, MINDAYS))
self.policies.append(BuildDependsPolicy(self.options, self.suite_info))
for policy in self.policies:
policy.register_hints(self._hint_parser)
@property
def hints(self):
return self._hint_parser.hints

Loading…
Cancel
Save