[Toybox] sort -V

enh enh at google.com
Wed Dec 19 11:41:26 PST 2018


it turns out that we have a few users of `sort -V`. i'd always assumed
this meant "use the GNU strverscmp(3) function as your comparator" but
no, it's slightly different...

https://www.gnu.org/software/coreutils/manual/html_node/Details-about-version-sort.html

the first github match for that function says this:

  This implements the algorithm for comparison of version strings
  specified by Debian and now widely adopted. The detailed
  specification can be found in the Debian Policy Manual in the
  section on the 'Version' control field. This version of the code
  implements that from s5.6.12 of Debian Policy v3.8.0.1
  http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version

at which point i _wish_ it was just the stupid strverscmp...


More information about the Toybox mailing list