1 |
Always group all Prefix keywords after other types of keywords. This |
2 |
not only ensures that fbsd sorts first but more importantly stabilizes |
3 |
the LHS output between regular and -P variant -- that is, -P always adds |
4 |
additional keywords at the end. |
5 |
--- |
6 |
pym/gentoolkit/eshowkw/keywords_header.py | 16 ++++++++++------ |
7 |
1 file changed, 10 insertions(+), 6 deletions(-) |
8 |
|
9 |
diff --git a/pym/gentoolkit/eshowkw/keywords_header.py b/pym/gentoolkit/eshowkw/keywords_header.py |
10 |
index 41b8ba4..1b64bfd 100644 |
11 |
--- a/pym/gentoolkit/eshowkw/keywords_header.py |
12 |
+++ b/pym/gentoolkit/eshowkw/keywords_header.py |
13 |
@@ -142,12 +142,16 @@ class keywords_header: |
14 |
break |
15 |
|
16 |
# sort by, in order (to match Bugzilla): |
17 |
- # 1. arch, then ~arch |
18 |
- # 2. profile stability |
19 |
- # 3. short keywords, then long (prefix, fbsd) |
20 |
- # 4. keyword name in reverse component order |
21 |
- normal.sort(key=lambda kw: (kw in self.__TESTING_KW_ARCHS, |
22 |
- levels.get(kw, 99), kw.count('-'), list(reversed(kw.split('-'))))) |
23 |
+ # 1. non-prefix, then prefix (stable output between -P and not) |
24 |
+ # 2. arch, then ~arch |
25 |
+ # 3. profile stability |
26 |
+ # 4. short keywords, then long (prefix, fbsd) |
27 |
+ # 5. keyword name in reverse component order |
28 |
+ normal.sort(key=lambda kw: (self.__isPrefix(kw), |
29 |
+ kw in self.__TESTING_KW_ARCHS, |
30 |
+ levels.get(kw, 99), |
31 |
+ kw.count('-'), |
32 |
+ list(reversed(kw.split('-'))))) |
33 |
return normal |
34 |
|
35 |
def __readAdditionalFields(self): |
36 |
-- |
37 |
2.16.1 |