Example: cvs/gentoo-x86/sys-devel/automake $ eshowkw Keywords for sys-devel/automake: | a a a h i m m p p s s s x | u s | r | l m r p a 6 i p p 3 h p 8 | n l | e | p d m p 6 8 p c c 9 a 6 | u o | p | h 6 a 4 k s 6 0 r | s t | o | a 4 4 c | e | | | d | -------------+---------------------------+--------+------- [I]1.10.3 | + + + + + + ~ + + + + + + | o 1.10 | gentoo -------------+---------------------------+--------+------- [I]1.11.1 | + + + + + + ~ + + + + + + | o 1.11 | gentoo 1.11.1-r1 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | # | gentoo 1.11.2 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | # | gentoo 1.11.2-r1 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | # | gentoo 1.11.3 | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | o | gentoo -------------+---------------------------+--------+------- 1.4_p6-r1 | + + + + + + ~ + + + + + + | o 1.4 | gentoo -------------+---------------------------+--------+------- 1.5-r1 | + + + + + + ~ + + + + + + | o 1.5 | gentoo -------------+---------------------------+--------+------- 1.6.3-r1 | + + + + + + ~ + + + + + + | o 1.6 | gentoo -------------+---------------------------+--------+------- 1.7.9-r2 | + + + + + + ~ + + + + + + | o 1.7 | gentoo -------------+---------------------------+--------+------- 1.8.5-r4 | + + + + + + ~ + + + + + + | o 1.8 | gentoo -------------+---------------------------+--------+------- [I]1.9.6-r3 | + + + + + + ~ + + + + + + | o 1.9 | gentoo -------------+---------------------------+--------+------- 9999 | o o o o o o o o o o o o o | o 9999 | gentoo
That output is sorted. It is just not numerically sorted, but normal alphabetically sorted. In order to sort it numerically it means breaking apart the sections and padding them to more digits. Then plain sorting the padded slots. ie. 1.1 ==> 001.001, 1.10 ==> 001.010, 1.1.2 ==> 001.001.002
Actually, this looks like a bug in the code. The function doing the sorting was sorting the list of packages twice. The first time with vercmp from portage and the second time using python's itemgetter function. I deleted the sort with itemgetter and committed the change. This produces the correct output. http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=ba64705ea61bbfe506bee228b56758216ffb987c
This was released with gentoolkit-0.3.0.6-r2