Bug#914748: ant: Fail when installed along with usrmerge and invoked via /bin/ant
Gilles Filippini
pini at debian.org
Mon Nov 26 21:46:23 GMT 2018
Package: ant
Version: 1.9.10-1
Severity: serious
Tags: patch
Justification: Causes FTBFS
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Hi,
When installed along with usrmerge, ant can be invoked via /bin/ant. In this case it fails with:
/bin/ant: 1: cd: can't cd to /bin/../share/ant/bin/..
Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
The attached patch solves the problem for me.
Setting severity to serious because it causes FTBFS. See for example [1].
[1] https://buildd.debian.org/status/fetch.php?pkg=opencv&arch=amd64&ver=3.2.0%2Bdfsg-4.1%2Bb2&stamp=1542819371&raw=0
Thanks,
_g.
-----BEGIN PGP SIGNATURE-----
iQEzBAEBCgAdFiEEoJObzArDE05WtIyR7+hsbH/+z4MFAlv8aaYACgkQ7+hsbH/+
z4MTeAf/dTyabk7caN+jIGWSZfSxW3HTob2CoGUHbTDclbZvVfX91PvbszNJlADO
kXgPZI6ngOky3gx0MwH8H/SqQFt2PamHFdfguSpxWG7ARIERxII7D0ifhFd4eU4V
S1RA/ZH1qP98pTX1FFDTBC4l3a8qqDXgIIOmhWqkqiXcbnG9nJMmOdQJWRDjVHQk
9YI3Si/M9wTATCF6fyQhCUG4YqstY6+5ITvuHnQzFhGebC7TElZDuwqF46ZGNnNp
0LXUZjj1A2/UYGzdx0t2YepcHHXd9tFbrDLUZN2OdIaxNorZGoq1xHAEA7x5ussm
gRyZebWqgf3B2jGmXs194+27iAt1XQ==
=Zgso
-----END PGP SIGNATURE-----
-------------- next part --------------
diff -Nru ant-1.10.5/debian/changelog ant-1.10.5/debian/changelog
--- ant-1.10.5/debian/changelog 2018-08-27 14:57:47.000000000 +0200
+++ ant-1.10.5/debian/changelog 2018-11-26 22:00:46.000000000 +0100
@@ -1,3 +1,11 @@
+ant (1.10.5-2.1) UNRELEASED; urgency=medium
+
+ * Non-maintainer upload.
+ * New patch usrmerge-proof.patch to fix failure when installed along
+ with usrmerge and invoked via /bin/ant
+
+ -- Gilles Filippini <pini at debian.org> Mon, 26 Nov 2018 22:00:46 +0100
+
ant (1.10.5-2) unstable; urgency=medium
* Team upload.
diff -Nru ant-1.10.5/debian/patches/series ant-1.10.5/debian/patches/series
--- ant-1.10.5/debian/patches/series 2018-08-27 14:57:47.000000000 +0200
+++ ant-1.10.5/debian/patches/series 2018-11-26 21:55:03.000000000 +0100
@@ -4,3 +4,4 @@
0013-auto-adjust-target.patch
0015-javadoc-ignore-source-errors.patch
0014-remove-java-activation-module.patch
+usrmerge-proof.patch
diff -Nru ant-1.10.5/debian/patches/usrmerge-proof.patch ant-1.10.5/debian/patches/usrmerge-proof.patch
--- ant-1.10.5/debian/patches/usrmerge-proof.patch 1970-01-01 01:00:00.000000000 +0100
+++ ant-1.10.5/debian/patches/usrmerge-proof.patch 2018-11-26 22:00:43.000000000 +0100
@@ -0,0 +1,26 @@
+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.
+Index: ant-1.10.5/src/script/ant
+===================================================================
+--- ant-1.10.5.orig/src/script/ant
++++ ant-1.10.5/src/script/ant
+@@ -144,15 +144,7 @@ if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME"
+ 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"`/..
+
More information about the pkg-java-maintainers
mailing list