[Toybox] sort -V test?
Rob Landley
rob at landley.net
Thu Oct 15 20:57:49 PDT 2020
On 10/15/20 6:59 PM, enh wrote:
> one reason bionic doesn't implement strverscmp() is that afaik not
> even the GNU tools use it. they all have slightly different ideas
> about how versions should be sorted :-/
I don't use it either, I did the sorting myself. But they changed how the
sorting works between versions.
Linux seems to have responded to this by deleting all of its -rc tarballs off
kernel.org and washing its hands of the issue entirely back in 2017:
https://www.kernel.org/rc-tarballs-and-patches-starting-with-412-rc1.html
> (i'll also note that the old behavior matches sort's/librarians'
> general "something comes before nothing" rule, so the new behavior
> seems like a bug?)
In normal sort, nothing comes before something:
$ echo -e 'one\noneone\noneoneone' | sort
one
oneone
oneoneone
But an -rc file is logically before the release version that is _not_ an rc. If
you're GOING to have a version sort, that seems kind of important?
Rob
More information about the Toybox
mailing list