From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 46F3713835A for ; Tue, 5 Jan 2021 19:09:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 40EA6E084E; Tue, 5 Jan 2021 19:09:52 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EF79DE084E for ; Tue, 5 Jan 2021 19:09:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 943FC33BEAC for ; Tue, 5 Jan 2021 19:09:50 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 078B64B for ; Tue, 5 Jan 2021 19:09:49 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1609873786.962f937e460a3204d43b6772665494e1d9250d6a.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/auto-bootstraps/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/auto-bootstraps/analyse_result.py X-VCS-Directories: scripts/auto-bootstraps/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 962f937e460a3204d43b6772665494e1d9250d6a X-VCS-Branch: master Date: Tue, 5 Jan 2021 19:09:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fbca1597-4fba-4c2e-96ef-1a579b211cd1 X-Archives-Hash: ddf3d0d685bea90a3d7d02b6383384bd commit: 962f937e460a3204d43b6772665494e1d9250d6a Author: Fabian Groffen gentoo org> AuthorDate: Tue Jan 5 19:08:05 2021 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Tue Jan 5 19:09:46 2021 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=962f937e scripts/auto-bootstraps/analyse_result: sort triplets more complicatedly - sort by os, vendor, cpu - sort os by name, and its version Signed-off-by: Fabian Groffen gentoo.org> scripts/auto-bootstraps/analyse_result.py | 32 ++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/scripts/auto-bootstraps/analyse_result.py b/scripts/auto-bootstraps/analyse_result.py index b2cc9bfec8..880fd64343 100755 --- a/scripts/auto-bootstraps/analyse_result.py +++ b/scripts/auto-bootstraps/analyse_result.py @@ -5,6 +5,7 @@ import glob import re import time import html +from functools import cmp_to_key resultsdir='./results' @@ -171,7 +172,36 @@ with os.scandir(resultsdir) as it: endc = '\033[0m' print("%s%30s: suc %8s fail %8s%s" % (color, arch, suc, fail, endc)) -sarchs = sorted(archs, key=lambda a: '-'.join(a.split('-')[::-1])) +def archSort(l, r): + """ + Sort by os, vendor, cpu + """ + lcpu, lvendor, los = l.split('-', 2) + losname = re.split('\d', los, 1)[0] + losver = los.split(losname, 1)[1] + rcpu, rvendor, ros = r.split('-', 2) + rosname = re.split('\d', ros, 1)[0] + rosver = ros.split(rosname, 1)[1] + + if losname > rosname: + return 1 + if losname < rosname: + return -1 + if float(losver) > float(rosver): + return 1 + if float(losver) < float(rosver): + return -1 + if lvendor > rvendor: + return 1 + if lvendor < rvendor: + return -1 + if lcpu > rcpu: + return 1 + if lcpu < rcpu: + return -1 + return 0 + +sarchs = sorted(archs, key=cmp_to_key(archSort)) def gentags(infos): tags = ''