diff options
author | Michał Górny <mgorny@gentoo.org> | 2018-01-23 22:42:19 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2018-01-26 15:50:50 +0100 |
commit | 70b2518f12f63071f0192c23826188bd456698e7 (patch) | |
tree | 1b179b740c6c631e39a08704d3995f54f6b13289 | |
parent | eshowkw: Group Prefix keywords by system (diff) | |
download | gentoolkit-0.4.2.tar.gz gentoolkit-0.4.2.tar.bz2 gentoolkit-0.4.2.zip |
eshowkw: Always group Prefix keywords lastgentoolkit-0.4.2
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.
-rw-r--r-- | pym/gentoolkit/eshowkw/keywords_header.py | 16 |
1 files 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): |