Package: ant / 1.10.13-1~bpo11+1

0017-usrmerge-proof.patch Patch series | download
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
Description: With usrmerge configured, ant may be called via /bin/ant.
 In this case it fails with:
  /bin/ant: 1: cd: can't cd to /bin/../share/ant/bin/..
 Using 'readlink -f' instead of this cumbersome while loop solves the problem.
Author: Gilles Filippini <pini@debian.org>
Forwarded: no
--- a/src/script/ant
+++ b/src/script/ant
@@ -144,15 +144,7 @@
   progname=`basename "$0"`
 
   # need this for relative symlinks
-  while [ -h "$PRG" ]; do
-    ls=`ls -ld "$PRG"`
-    link=`expr "$ls" : '.*-> \(.*\)$'`
-    if expr "$link" : '/.*' > /dev/null; then
-      PRG="$link"
-    else
-      PRG=`dirname "$PRG"`"/$link"
-    fi
-  done
+  PRG=`readlink -f $PRG`
 
   ANT_HOME=`dirname "$PRG"`/..