adding jar files to $ANT_HOME/lib is a common requirement for custom ant tasks. The command `java-config --classpath=ant` returns the (presumably) hard coded values of $ANT_HOME/lib/ant.jar and $ANT_HOME/lib/optional.jar It should return all .jar files in this directory. The script /usr/bin/ant relies on the output of `java-config --classpath=ant` Reproducible: Always Steps to Reproduce: 1. Add a jar file to $ANT_HOME/lib 2. Execute `java-config --classpath=ant` Actual Results: darren@garbo spring $ ls $ANT_HOME/lib -al total 1997 drwxr-xr-x 2 root root 304 2003-12-30 01:19 . drwxr-xr-x 3 root root 104 2003-12-10 13:03 .. -rw-r--r-- 1 root root 736578 2003-12-10 13:03 ant.jar -rw-r--r-- 1 root root 121070 2003-12-10 14:50 junit.jar -rw-r--r-- 1 root root 675635 2003-12-10 13:03 optional.jar darren@garbo spring $ java-config --classpath=ant /usr/share/ant/lib/ant.jar:/usr/share/ant/lib/optional.jar Expected Results: darren@garbo spring $ ls $ANT_HOME/lib -al total 1997 drwxr-xr-x 2 root root 304 2003-12-30 01:19 . drwxr-xr-x 3 root root 104 2003-12-10 13:03 .. -rw-r--r-- 1 root root 736578 2003-12-10 13:03 ant.jar -rw-r--r-- 1 root root 121070 2003-12-10 14:50 junit.jar -rw-r--r-- 1 root root 675635 2003-12-10 13:03 optional.jar darren@garbo spring $ java-config --classpath=ant /usr/share/ant/lib/ant.jar:/usr/share/ant/lib/optional.jar:/usr/share/ant/lib/junit.jar darren@garbo spring $ emerge info Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.22) ================================================================= System uname: 2.4.22 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz Gentoo Base System version 1.4.3.10 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="sandbox ccache autoaddcvs" GENTOO_MIRRORS="ftp://bacall.davison.uk.net http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://bacall.davison.uk.net/usr-portage" USE="oss apm avi cups encode foomaticdb gif gtk2 libg++ libwww mad mikmod mpeg nls pdflib png quicktime spell xml2 xmms xv zlib alsa gdbm berkdb slang readline arts svga sdl gpm pam perl python esd imlib oggvorbis gtk motif opengl mozilla gphoto2 cdr crypt dga dvd java jpeg kde -gnome mysql ncurses qt ssl tcpd truetype X x86 video_cards_i810"
java-config uses a package.env or classpath.env file for a package to find the classpath for a specified package -- one solution would be to add a special case for ant but that doesn't seem that viable. I'm open to suggestions for an alternate scheme to determine ant's (and similar package's) classpath -- perhaps another alternate entry in a .env file that would indicate that java-config needed to scan certain directories for .jar files. CLASSPATHJARS=/usr/share/ant/lib
Also, what version of java-config are you using?
I'm using java-config 1.17 Currently I'm working aroud this by hacking /usr/bin/ant as follows.. # add in the dependency .jar files #LOCALCLASSPATH="${LOCALCLASSPATH}:`java-config --classpath=ant`" # added to fix the ANT_HOME/lib jar files for x in `ls ${ANT_HOME}/lib -1`; do ANT_CP=${ANT_HOME}/lib/${x}:$ANT_CP done LOCALCLASSPATH=${ANT_CP}:${LOCALCLASSPATH} # end my stuff I looked at java-config but I know zip about python so left it alone. But if java-config could be made to do shell-expansion stuff like that above, then possibly package.env could contain similar kind of code in its CLASSPATH= line.
We probably want to do something like #28869 in this case; have /usr/share/ant/packages contain symlinks to env files for the additional ant packages. This way, the additional (optional) packages will automatically and properly be removed upon unmerge.
Fixed in 1.1.8 and 1.2.0 as per kalktk's suggestions.
Version 1.1.8 is stable.