From 3f575a1cd01d048950d1a63907cbe45b45496777 Mon Sep 17 00:00:00 2001 From: Ivo De Decker Date: Fri, 4 Jan 2019 23:02:15 +0000 Subject: [PATCH] For b-d-indep track best result and archs per result Signed-off-by: Ivo De Decker --- britney2/policies/policy.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/britney2/policies/policy.py b/britney2/policies/policy.py index 1e07e86..8844ce4 100644 --- a/britney2/policies/policy.py +++ b/britney2/policies/policy.py @@ -850,6 +850,8 @@ class BuildDependsPolicy(BasePolicy): excuses_info = defaultdict(list) blockers = defaultdict(list) arch_results = {} + result_archs = defaultdict(list) + bestresult = BuildDepResult.FAILED check_archs = self._get_check_archs(relevant_archs,dep_type); for arch in check_archs: # retrieve the binary package from the specified suite and arch @@ -895,6 +897,15 @@ class BuildDependsPolicy(BasePolicy): if arch_results[arch] < BuildDepResult.DEPENDS: arch_results[arch] = BuildDepResult.DEPENDS + if dep_type == DependencyType.BUILD_DEPENDS_INDEP: + if arch_results[arch] < bestresult: + bestresult = arch_results[arch] + result_archs[arch_results[arch]].append(arch) + if bestresult == BuildDepResult.OK: + # we found an architecture where the b-deps-indep are + # satisfied in the target suite, so we can stop + break + for arch in check_archs: verdict = self._add_info_for_arch(arch, excuses_info, blockers, arch_results, dep_type, target_suite, source_suite, excuse, verdict)