From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47005 invoked by alias); 30 Oct 2017 15:15:32 -0000 Mailing-List: contact kawa-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: kawa-owner@sourceware.org Received: (qmail 46995 invoked by uid 89); 30 Oct 2017 15:15:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=2.1 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=no version=3.3.2 spammy=HContent-type:alternative, credits, couldn, couldn=e2?= X-HELO: pv33p04im-asmtp002.me.com Received: from pv33p04im-asmtp002.me.com (HELO pv33p04im-asmtp002.me.com) (17.143.181.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 30 Oct 2017 15:15:29 +0000 Received: from process-dkim-sign-daemon.pv33p04im-asmtp002.me.com by pv33p04im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0OYN00N00693KV00@pv33p04im-asmtp002.me.com> for kawa@sourceware.org; Mon, 30 Oct 2017 15:15:27 +0000 (GMT) Received: from icloud.com ([127.0.0.1]) by pv33p04im-asmtp002.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0OYN00KMQ6CSUG40@pv33p04im-asmtp002.me.com>; Mon, 30 Oct 2017 15:15:27 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-30_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=15 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710300207 MIME-version: 1.0 (Mac OS X Mail 11.0 \(3445.1.7\)) Subject: Re: symlink problems with mac os From: =?utf-8?Q?Bj=C3=B6rn_Raupach?= In-reply-to: Date: Mon, 30 Oct 2017 15:15:00 -0000 Cc: "kawa@sourceware.org" X-Clacks-Overhead: GNU Terry Pratchett Message-id: <3B304768-07B4-4094-A757-64C5A152AA7D@me.com> References: <7DC458EC-78C0-40B3-871F-5B0E72E43CF5@e2n.de> <0cfce2d5-3e68-bf23-95c6-f6fc6e717f99@bothner.com> <9a15e187-6123-2c5a-181b-e4ebb9ac0dc8@bothner.com> <4A6C2C7B-39EE-4D32-9A2D-D715CFD62D3B@me.com> To: Per Bothner Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-q4/txt/msg00025.txt.bz2 > On 23. Oct 2017, at 18:55, Per Bothner wrote: >=20 > On 10/22/2017 11:47 PM, Bj=C3=B6rn Raupach wrote: >=20 >> Thanks for spending time on this. Like I said it is really a minor issue. >=20 > True. Regardless, I prefer a cleaner/simpler file layout that minimizes s= ymlinks. > If that can avoid a problem on Mac so much the better. I found a to my understanding cleaner approach that doesn't rely on install= ing coreutils, python or some other dependency. Just pure bash. Credits go = to Apache Maven and Apache Tomcat. I didn=E2=80=99t come up with this, I ju= st looked how they did it. Below is a modified version of the kawa bash script. Everything after the l= ast line wasn=E2=80=99t touched. #!/bin/bash thisfile=3D`command -v $0` case "$thisfile" in "") echo "installation error - can't find path to $0"; exit -1 ;; /*) ;; *) thisfile=3D"$PWD/$thisfile" ;; esac while [ -h "$thisfile" ]; do ls=3D`ls -ld "$thisfile"` link=3D`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then thisfile=3D"$link" else thisfile=3D`dirname =E2=80=9C$thisfile"`/"$link" fi done thisdir=3D`dirname "$thisfile"` kawadir=3D`cd "$thisdir/.." >/dev/null; pwd` Instead of using readlink -f they just parse the output of the ls command. = To get to the kawadir directory they use cd instead of realpath. Works!=20 Not a lawyer, so I am not sure if this copy&paste is some license infringem= ent. >=20 >> Unfortunately I couldn=E2=80=99t make it work. Might be a misunderstandi= ng on my part. >=20 > I forgot about this: there is a both a share/kawa/bin/kawa, and a bin/kawa > that is a link to the latter. That seems ugly. The reason is so that the > kawa script can just look for ../kawa/lib/kawa.jar, regardless of whether= we: > (1) run-in-place in the build directory, > (2) run installed files (result of 'make install'), or > (3) run from an unzipped kawa.zip binary distribution. >=20 > I think there are better ways to solve this "multi-mode problem" - one is > for 'make install' to make a one-line patch to the kawa script as it is i= nstalled. >=20 > --=20 > --Per Bothner > per@bothner.com http://per.bothner.com/