[MacPorts] #60051: gildas @202002a: sort: invalid option -- V

MacPorts noreply at macports.org
Mon Jun 15 13:46:15 UTC 2020


#60051: gildas @202002a: sort: invalid option -- V
-------------------------+----------------------
  Reporter:  ryandesign  |      Owner:  bardeau
      Type:  defect      |     Status:  assigned
  Priority:  Normal      |  Milestone:
 Component:  ports       |    Version:  2.6.2
Resolution:              |   Keywords:
      Port:  gildas      |
-------------------------+----------------------

Comment (by ryandesign):

 macOS `sort` has a `-V` option on High Sierra and newer but not on El
 Capitan and older. I didn't test Sierra. I'm told busybox's `sort` also
 doesn't have `-V`. So it's not portable to use that.

 If you don't care about portability, you can add a dependency on
 port:coreutils and use `${prefix}/bin/gsort` instead of `sort`. It does
 support `-V`.

 [https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-
 in-dot-separated-version-format-in-bash There are many other potential
 solutions to this problem] of varying portability and correctness. I
 haven't tried them myself but maybe you'll see a method in there that you
 like.

-- 
Ticket URL: <https://trac.macports.org/ticket/60051#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list