aboutsummaryrefslogtreecommitdiffstats
path: root/lang/kawa/files/patch-bin_kawa.sh.in
blob: 7ad01b8a3ecf36886e01a6f2dd906629938837ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- bin/kawa.sh.in.orig 2016-11-22 21:30:51 UTC
+++ bin/kawa.sh.in
@@ -1,13 +1,7 @@
 #!@KAWA_SHELL@
-thisfile=`type -p $0`
-case "$thisfile" in
-  "") echo "installation error - can't find path to $0"; exit -1 ;;
-  /*) ;;
-  *) thisfile="$PWD/$thisfile"  ;;
-esac
-while test -L "$thisfile"; do thisfile=$(readlink -f "$thisfile"); done
-thisdir=`dirname "$thisfile"`
-kawadir=`echo "$thisdir" | sed -e 's|/bin\(/\.\)*$||'`
+
+kawadir=`readlink -f "$(dirname "$0")/.."`
+
 if [ "$#" -eq 0 ]
 then
    command_line="$0"
@@ -19,9 +13,9 @@ test -t 0 || no_console="--no-console"
 # If configured with --enable-kawa-frontend then kawa.sh is
 # only used for pre-install testing.  In that case
 # we don't need to set KAWALIB, since kawapath.c looks for it in "..".
-@ENABLE_KAWA_FRONTEND_TRUE@  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$thisdir
+@ENABLE_KAWA_FRONTEND_TRUE@  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$kawadir/bin
 @ENABLE_KAWA_FRONTEND_TRUE@  export LD_LIBRARY_PATH
-@ENABLE_KAWA_FRONTEND_TRUE@  exec $thisdir/kawa "$@"
+@ENABLE_KAWA_FRONTEND_TRUE@  exec $kawadir/bin/kawa "$@"
 
 KAWALIB=${KAWALIB-"`@CYGPATH_W@ $kawadir/lib/kawa.jar`"}
 # MSYS: KAWALIB=${KAWALIB-"`cd $kawadir/lib/; pwd -W`@CLASSPATH_SEPARATOR@kawa.jar`"}