SHA256
1
0
forked from pool/rpmlint
Dirk Mueller 2017-09-30 15:19:04 +00:00 committed by Git OBS Bridge
parent 1ce530fa60
commit 2d2af816d1

View File

@ -1,16 +1,43 @@
diff --git a/Filter.py b/Filter.py
index a728115..87b4009 100644
--- a/Filter.py
+++ b/Filter.py
@@ -111,8 +111,9 @@ def printDescriptions(reason):
@@ -43,15 +43,15 @@ else:
def printInfo(pkg, reason, *details):
- _print("I", pkg, reason, details)
+ _print('I', pkg, reason, details)
def printWarning(pkg, reason, *details):
- _print("W", pkg, reason, details)
+ _print('W', pkg, reason, details)
def printError(pkg, reason, *details):
- _print("E", pkg, reason, details)
+ _print('E', pkg, reason, details)
def _print(msgtype, pkg, reason, details):
@@ -111,8 +111,10 @@ def printDescriptions(reason):
def _diag_sortkey(x):
- xs = x.split()
- return (xs[2], xs[1])
+ xs = x.split(maxsplit=2)
+ # Primary Sort by Category: Info first, then Warnings, then Errors
+ # ['game.x86_64:', 'W:', 'call-to-mktemp /usr/games/lib/blub\n']
+ return (xs[2], xs[1], xs[0])
+ return (xs[2], str('IWE'.find(xs[1][0])), xs[0])
def printAllReasons():
@@ -121,7 +123,7 @@ def printAllReasons():
return False
global _diagnostic
- _diagnostic.sort(key=_diag_sortkey, reverse=True)
+ _diagnostic.sort(key=_diag_sortkey)
last_reason = ''
for diag in _diagnostic:
if Config.info: