Commit ab9720a0 authored by Jérome Perrin's avatar Jérome Perrin Committed by Kirill Smelkov

fmt: Sort emitted entries ignoring their case

@jerome says at kirr/nxd-bom!1 (comment 185299) :

    I feel this would be more natural sorting, in the current output we have
    all the upper case first and then all the lower case.
parent 53be4c2e
......@@ -432,7 +432,7 @@ def fmt_bom(bom): # -> str
for kind in sorted(kinds):
if kind != '':
emit('\n>>> %ss:' % kind)
for bkey in sorted(bom):
for bkey in sorted(bom, key=lambda _: _[0].lower()): # by name, ignoring case
info = bom[bkey]
if info.kind == kind:
# TODO autoalign
......
......@@ -184,8 +184,8 @@ eggs = lxml
-- /ROOT/eggs/Mako-1.1.4-py2.7.egg/x --
""", """
>>> eggs:
Mako 1.1.4 https://pypi.org/project/Mako/1.1.4/
lxml 4.9.1 https://pypi.org/project/lxml/4.9.1/
Mako 1.1.4 https://pypi.org/project/Mako/1.1.4/
pycurl 7.43.0 https://pypi.org/project/pycurl/7.43.0/
""")
......@@ -335,10 +335,10 @@ url = http://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
recipe = slapos.recipe.cmmi
url = https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tar.xz
""", """\
Python 2.7.18 http://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
Python3 3.9.15 https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tar.xz
libpng 1.6.37 http://download.sourceforge.net/libpng/libpng-1.6.37.tar.xz
libpng12 1.2.59 http://download.sourceforge.net/libpng/libpng-1.2.59.tar.xz
Python 2.7.18 http://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
Python3 3.9.15 https://www.python.org/ftp/python/3.9.15/Python-3.9.15.tar.xz
readline 8.1 http://ftp.gnu.org/gnu/readline/readline-8.1.tar.gz
readline5 5.2 http://ftp.gnu.org/gnu/readline/readline-5.2.tar.gz
""")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment