NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: toolchain/51457 (Incorrect postinstall version-number sort options)
The following reply was made to PR toolchain/51457; it has been noted by GNATS.
From: Michael Plass <mfpnb%plass-family.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Michael Plass <mfpnb%plass-family.net@localhost>
Subject: Re: toolchain/51457 (Incorrect postinstall version-number sort options)
Date: Fri, 2 Sep 2016 07:52:41 -0700
> On Sep 1, 2016, at 10:42 PM, kre%NetBSD.org@localhost wrote:
>
> Does it work correcty for you now?
No, not for cross builds - On both FreeBSD 11 and OS X:
$ printf '7.9.1\n7.9.0\n7.9.10\n7.10.1\n' | sort -t. -r -k1,1n -k2,2n -k3,3n
7.9.0
7.9.1
7.9.10
7.10.1
This is (I think) because posix says that "If any modifier is attached to a
field_start or to a field_end, no option shall apply to either."
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html
The NetBSD sort does this differently, but then again the man page doesn't
mention posix.
So to use modifiers, it needs to be
sort -t. -k1,1nr -k2,2nr -k3,3nr
but is there a reason not to use
sort -t. -nr -k1,1 -k2,2 -k3,3
?
Thanks,
- Michael
Home |
Main Index |
Thread Index |
Old Index