mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-06 15:43:39 +02:00
Add cmp function to packagequery module
cmp(a, b) returns -1 if a < b 0 if a == 0 1 if a > b This is needed since python3 has no cmp function anymore. All credits for this go to Marco Strigl <mstrigl@suse.com> (see PR#483 [1]). [1] https://github.com/openSUSE/osc/pull/483
This commit is contained in:
@@ -159,6 +159,11 @@ class PackageQueryResult:
|
||||
evr = epoch + ":" + evr
|
||||
return evr
|
||||
|
||||
|
||||
def cmp(a, b):
|
||||
return (a > b) - (a < b)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
try:
|
||||
|
Reference in New Issue
Block a user