[MacPorts] #60051: gildas @202002a: sort: invalid option -- V
MacPorts
noreply at macports.org
Tue Jun 16 15:44:18 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 bardeau):
Replying to [comment:2 ryandesign]:
> 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`.
What is the proper way to to invoke gsort from my shell script? Is
${prefix} supposed to be a valid environment variable? It does not seem:
{{{
/opt/local/var/macports/build/_opt_local_var_macports_sources_github
.com_macports_macports-ports_science_gildas/gildas/work/gildas-src-
jun20b/admin/define-system.sh: line 28: /bin/gsort: No such file or
directory
}}}
Isn't there a configure.* keyword I could use for reinplacement?
> [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.
I precisely used one of the method proposed on this page (verle-verlt). A
lot of methods contain bashisms which are not portable (in particular to
dash or zsh). The verlt-verle is the softest solution I could find, at the
cost of depending on a sort -V implementation.
--
Ticket URL: <https://trac.macports.org/ticket/60051#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list