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 4E6B21382C5 for ; Fri, 26 Jan 2018 23:25:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AE798E09DD; Fri, 26 Jan 2018 23:25:45 +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 8C36AE09DD for ; Fri, 26 Jan 2018 23:25:45 +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 AAC7F335C33 for ; Fri, 26 Jan 2018 23:25:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9819E1D6 for ; Fri, 26 Jan 2018 23:25:41 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1516978250.70b2518f12f63071f0192c23826188bd456698e7.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/eshowkw/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/eshowkw/keywords_header.py X-VCS-Directories: pym/gentoolkit/eshowkw/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 70b2518f12f63071f0192c23826188bd456698e7 X-VCS-Branch: master Date: Fri, 26 Jan 2018 23:25:41 +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-Archives-Salt: 61699f5c-dc4d-4eb0-9b03-6f62483fdf60 X-Archives-Hash: 5f3452f18ad2662239989af99afbb82c commit: 70b2518f12f63071f0192c23826188bd456698e7 Author: Michał Górny gentoo org> AuthorDate: Tue Jan 23 21:42:19 2018 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Jan 26 14:50:50 2018 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=70b2518f eshowkw: Always group Prefix keywords last Always group all Prefix keywords after other types of keywords. This not only ensures that fbsd sorts first but more importantly stabilizes the LHS output between regular and -P variant -- that is, -P always adds additional keywords at the end. pym/gentoolkit/eshowkw/keywords_header.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pym/gentoolkit/eshowkw/keywords_header.py b/pym/gentoolkit/eshowkw/keywords_header.py index ce3e8d4..6557f60 100644 --- a/pym/gentoolkit/eshowkw/keywords_header.py +++ b/pym/gentoolkit/eshowkw/keywords_header.py @@ -142,12 +142,16 @@ class keywords_header: break # sort by, in order (to match Bugzilla): - # 1. arch, then ~arch - # 2. profile stability - # 3. short keywords, then long (prefix, fbsd) - # 4. keyword name in reverse component order - normal.sort(key=lambda kw: (kw in self.__TESTING_KW_ARCHS, - levels.get(kw, 99), kw.count('-'), list(reversed(kw.split('-'))))) + # 1. non-prefix, then prefix (stable output between -P and not) + # 2. arch, then ~arch + # 3. profile stability + # 4. short keywords, then long (prefix, fbsd) + # 5. keyword name in reverse component order + normal.sort(key=lambda kw: (self.__isPrefix(kw), + kw in self.__TESTING_KW_ARCHS, + levels.get(kw, 99), + kw.count('-'), + list(reversed(kw.split('-'))))) return normal def __readAdditionalFields(self):