From 839b1f3f68ac0d5ea226278f9c2538e6ea2a8c93 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 10 Oct 2017 13:27:17 +0100 Subject: [PATCH] Sort arches by priority Fixes #11503 Signed-off-by: Michael Tremer --- src/buildservice/arches.py | 19 +++++++++++++++++++ src/buildservice/builds.py | 3 ++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/buildservice/arches.py b/src/buildservice/arches.py index b06fd73..cf64823 100644 --- a/src/buildservice/arches.py +++ b/src/buildservice/arches.py @@ -2,6 +2,25 @@ from . import base +_priorities = { + "noarch" : 0, + + # 64 bit + "x86_64" : 1, + "aarch64" : 2, + + # 32 bit + "i686" : 3, + "armv7hl" : 4, + "armv5tel" : 5, +} + +def priority(arch): + try: + return _priorities[arch] + except KeyError: + return 99 + class Arches(base.Object): def get_all(self, really=False): query = "SELECT * FROM arches" diff --git a/src/buildservice/builds.py b/src/buildservice/builds.py index f2e9ef7..3356253 100644 --- a/src/buildservice/builds.py +++ b/src/buildservice/builds.py @@ -12,6 +12,7 @@ import pakfire import pakfire.config import pakfire.packages +from . import arches from . import base from . import builders from . import logs @@ -1514,7 +1515,7 @@ class Job(base.DataObject): return True if self.build == other.build: - return self.arch < other.arch # XXX needs to use the arch prio + return arches.priority(self.arch) < arches.priority(other.arch) return self.time_created < other.time_created -- 2.39.2