This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: symlink problems with mac os
- From: Per Bothner <per at bothner dot com>
- To: Björn Raupach <raupach at e2n dot de>, "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Sun, 22 Oct 2017 05:53:40 -0700
- Subject: Re: symlink problems with mac os
- Authentication-results: sourceware.org; auth=none
- References: <7DC458EC-78C0-40B3-871F-5B0E72E43CF5@e2n.de>
On 10/22/2017 05:00 AM, Björn Raupach wrote:
The readlink version of macOS isn’t the same as GNU/Linux one. The latter version does follow symlinks with -f. The macOS one does not support this feature.
I stumbled upon this while working on a port for MacPorts<https://www.macports.org> Should make kawa easier to install and upgrade on macOS. (Of course it is already simple enough being a jar file and such…)
There is a Homebrew port fof Kawa which avoids the problem by patching
bin/kawa before installing it:
https://github.com/Homebrew/homebrew-core/blob/master/Formula/kawa.rb
Another option is to install GNU readlink.
I considered replacing readlink -f by realpath, but as Mac OS doesn't
have readlink either, I don't see how that would help.
We could make the script more complicated, so it can work with plain readlink,
perhaps based on https://github.com/mkropat/sh-realpath/blob/master/realpath.sh .
I'm not thrilled to complicate the script that much, but it may be better
than adding a dependency.
The reason for the readlink to handle the case that you install kawa
as a symlink for example /usr/local/bin/kawa -> /opt/kawa-3.0/bin/kawa .
I think that is useful to support - and it doesn't work without the -f.
--
--Per Bothner
per@bothner.com http://per.bothner.com/