From 584f75bbc059d7b733d29fa5c3fe5c347e413e29 Mon Sep 17 00:00:00 2001 From: Niels Thykier Date: Sun, 23 Dec 2018 19:59:48 +0000 Subject: [PATCH] Defer loading and registering of hints Signed-off-by: Niels Thykier --- britney.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/britney.py b/britney.py index c454d9f..879d2c2 100755 --- a/britney.py +++ b/britney.py @@ -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