cli: drop nvr sorting from list-builds

We've never prperly supported this option as it would need rpm compare
algorithm and there is also no other place in koji where we compare
NVRs. More sense makes to order builds by id (age) by default.

Related: https://pagure.io/koji/issue/3416
This commit is contained in:
Tomas Kopecek 2022-10-10 15:39:44 +02:00
parent 59f677321d
commit be554fef99
2 changed files with 15 additions and 15 deletions

View file

@ -3315,7 +3315,7 @@ def anon_handle_list_builds(goptions, session, args):
parser.add_option("--volume", help="List builds by volume ID")
parser.add_option("-k", "--sort-key", action="append", metavar='FIELD',
default=[], help="Sort the list by the named field. Allowed sort keys: "
"nvr, owner_name, state")
"build_id, owner_name, state")
parser.add_option("-r", "--reverse", action="store_true", default=False,
help="Print the list in reverse order")
parser.add_option("--quiet", action="store_true", default=goptions.quiet,
@ -3404,10 +3404,10 @@ def anon_handle_list_builds(goptions, session, args):
else:
parser.error("Filter must be provided for list")
if not options.sort_key:
options.sort_key = ['nvr']
options.sort_key = ['build_id']
else:
for s_key in options.sort_key:
if s_key not in ['nvr', 'owner_name', 'state']:
if s_key not in ['build_id', 'owner_name', 'state']:
warn("Invalid sort_key: %s." % s_key)
data = sorted(data, key=lambda b: [b.get(k) for k in options.sort_key],