diff options
author | Karl Trygve Kalleberg <karltk@gentoo.org> | 2002-09-08 00:22:06 +0000 |
---|---|---|
committer | Karl Trygve Kalleberg <karltk@gentoo.org> | 2002-09-08 00:22:06 +0000 |
commit | 7461ad166fbfef4c1f79e851eafcc54055fbc477 (patch) | |
tree | 92bc5b7592439744c2d2e7af85f7674062b26fe2 /dev-java | |
parent | gcc32 fix (diff) | |
download | gentoo-2-7461ad166fbfef4c1f79e851eafcc54055fbc477.tar.gz gentoo-2-7461ad166fbfef4c1f79e851eafcc54055fbc477.tar.bz2 gentoo-2-7461ad166fbfef4c1f79e851eafcc54055fbc477.zip |
Fixes CLASSPATH problems
Diffstat (limited to 'dev-java')
-rw-r--r-- | dev-java/java-config/ChangeLog | 9 | ||||
-rw-r--r-- | dev-java/java-config/files/0.2.5/java-config (renamed from dev-java/java-config/files/java-config) | 39 | ||||
-rw-r--r-- | dev-java/java-config/files/0.2.5/java-config.1 (renamed from dev-java/java-config/files/java-config.1) | 0 | ||||
-rw-r--r-- | dev-java/java-config/files/digest-java-config-0.2.4-r1 | 0 | ||||
-rw-r--r-- | dev-java/java-config/files/java-config-0.2.5 | 326 | ||||
-rw-r--r-- | dev-java/java-config/java-config-0.2.4-r1.ebuild | 18 | ||||
-rw-r--r-- | dev-java/java-config/java-config-0.2.5.ebuild | 8 |
7 files changed, 41 insertions, 359 deletions
diff --git a/dev-java/java-config/ChangeLog b/dev-java/java-config/ChangeLog index c4f9984ec43d..51f84a33101b 100644 --- a/dev-java/java-config/ChangeLog +++ b/dev-java/java-config/ChangeLog @@ -1,11 +1,14 @@ # ChangeLog for dev-java/java-config # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/ChangeLog,v 1.10 2002/09/07 23:45:00 owen Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/ChangeLog,v 1.11 2002/09/08 00:22:06 karltk Exp $ + *java-config-0.2.5 (07 Sep 2002) - 07 Sep 2002; Owen Stampflee <owen@gentoo.org> java-config-0.2.5.ebuild files/digest-java-config-0.2.5 files/java-config-0.2.5 : - New Version to handle "." in CLASSPATH. + + 07 Sep 2002; Karl Trygve Kalleberg <karltk@gentoo.org> java-config-0.2.5.ebuild files/digest-java-config-0.2.5 files/java-config files/0.2.5/java-config files/0.2.5/java-config.1 : + Updated java-config to handle CLASSPATHs better. *java-config-0.2.4-r1 (24 Jun 2002) + 09 Aug 2002; Mark Guertin <gerk@gentoo.org> java-config-0.2.4-r1.ebuild : Added ppc to keywords diff --git a/dev-java/java-config/files/java-config b/dev-java/java-config/files/0.2.5/java-config index e31d8234dc0e..c0a563f93bce 100644 --- a/dev-java/java-config/files/java-config +++ b/dev-java/java-config/files/0.2.5/java-config @@ -1,12 +1,12 @@ #! /bin/sh # -# Copyright 1999-2001 Gentoo Technologies, Inc. +# Copyright 2001-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # Maintainer: Tools Team <tools@gentoo.org> # Author: Karl Trygve Kalleberg <karltk@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/files/java-config,v 1.14 2002/09/07 23:47:22 owen Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/files/0.2.5/java-config,v 1.1 2002/09/08 00:22:06 karltk Exp $ -version=0.2.0 +version=0.2.5 all_params="$*" SYSTEM_ARCH=`echo $ARCH |\ @@ -19,7 +19,6 @@ fi PFORM="i386" -CLASSPATH=`echo ${CLASSPATH} | sed "s/:\.//g"` case $SYSTEM_ARCH in ppc) PFORM="ppc";; i386) PFORM="i386";; @@ -98,7 +97,29 @@ classpathfor() exit 1 fi done - echo $total | sed "s/::/:/g" + echo $total | sed "s/::/:/g" +} + +normalise_classpath() { + local iter=`echo $1|sed "s/::/:/g"|sed "s/^://"` + local result + oldifs=${IFS} + IFS=":" + set -f -- ${iter} + while [ "$1" != "" ] ; do + found=`false` + for i in ${result} ; do + if [ "$i" == "$1" ] ; then + found=1 + fi + done + if [ ! $found ] && [ $1 != "." ] ; then + result="${result}:$1" + fi + shift + done + IFS="${oldifs}" + echo ${result} | sed "s/^://" } findpluginpath() { @@ -210,7 +231,9 @@ function set_vm() { } function calc_full_classpath() { - echo "${CLASSPATH}:`classpathfor $1`:." | sed "s/::/:/g" + local foo=`classpathfor $1` + local bar=`normalise_classpath "${CLASSPATH}:${foo}"` + echo "${bar}:." } if [ $# == 0 ] ; then @@ -241,10 +264,10 @@ while test $# -gt 0; do findpluginpath $optarg ;; --classpath) - echo ${CLASSPATH} + normalise_classpath ${CLASSPATH} ;; --classpath=*) - classpathfor $optarg + normalise_classpath `classpathfor $optarg` ;; --full-classpath=*) calc_full_classpath $optarg diff --git a/dev-java/java-config/files/java-config.1 b/dev-java/java-config/files/0.2.5/java-config.1 index 264d046fdf08..264d046fdf08 100644 --- a/dev-java/java-config/files/java-config.1 +++ b/dev-java/java-config/files/0.2.5/java-config.1 diff --git a/dev-java/java-config/files/digest-java-config-0.2.4-r1 b/dev-java/java-config/files/digest-java-config-0.2.4-r1 deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/dev-java/java-config/files/digest-java-config-0.2.4-r1 +++ /dev/null diff --git a/dev-java/java-config/files/java-config-0.2.5 b/dev-java/java-config/files/java-config-0.2.5 deleted file mode 100644 index 427b14b176f4..000000000000 --- a/dev-java/java-config/files/java-config-0.2.5 +++ /dev/null @@ -1,326 +0,0 @@ -#! /bin/sh -# -# Copyright 1999-2001 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License, v2 or later -# Maintainer: Tools Team <tools@gentoo.org> -# Author: Karl Trygve Kalleberg <karltk@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/files/java-config-0.2.5,v 1.1 2002/09/07 23:45:00 owen Exp $ - -version=0.2.0 -all_params="$*" - -SYSTEM_ARCH=`echo $ARCH |\ - sed -e s/[i]*.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/` - -if [ -z "$SYSTEM_ARCH" ] ; then - SYSTEM_ARCH=`uname -m |\ - sed -e s/[i]*.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/` -fi - -PFORM="i386" - -CLASSPATH=`echo ${CLASSPATH} | sed "s/:\.//g"` -case $SYSTEM_ARCH in - ppc) PFORM="ppc";; - i386) PFORM="i386";; - sparc64)PFORM="sparc64";; - sparc) PFORM="arm";; - arm) PFORM="arm";; -esac - -if [ $UID != 0 ] && [ -f $HOME/.gentoo/java-env ] ; then - . $HOME/.gentoo/java-env -elif [ -f /etc/env.d/20java ] ; then - oldpath=$PATH - . /etc/env.d/20java - PATH=$oldpath:$PATH -fi - -function eerror() { - echo "!!! $1" 1>&2 -} -svm=`echo $1|egrep "\-\-(set-(system|user)-vm|list-available-vms)"` -if [ -z "$JAVA_HOME" ] && [ -z "$svm" ] && [ "$1" != "--help" ]; then - eerror "No Java installation found" - eerror "Use --set-system-vm to select default system JVM" - eerror "Alternatively, use --set-user-vm to select default system JVM" - exit 1 -fi - -usage() { - cat <<EOF -Usage: java-config [OPTIONS] [LIBRARIES] -Options: - [--javac] - [--java] - [--jar] - [--jdk-home] - [--jre-home] - [--java-version] - [--classpath[=package1,package2,...]] - [--full-classpath=package1,package2,...] - [--exec=filename] - [--list-available-packages] - [--list-available-vms] - [--set-system-vm=<vm-id>] - [--set-user-vm=<vm-id>] - [--set-system-classpath=package1,package2,...] - [--set-user-classpath=package1,package2,...] -EOF - echo "Using ${JAVA_HOME}" - exit $1 -} - -find_exec() { - if [ -f ${JAVA_HOME}/bin/$1 ] ; then - echo ${JAVA_HOME}/bin/$1 - elif [ -f ${JAVA_HOME}/jre/bin/$1 ] ; then - echo ${JAVA_HOME}/jre/bin/$1 - else - eerror "$1 not found" - exit 1 - fi -} - -classpathfor() -{ - local pkgs=`echo $1 | sed "s/,/ /g"` - local total="" - for i in $pkgs ; do - if [ -f /usr/share/${i}/classpath.env ] ; then - total="${total}`cat /usr/share/${i}/classpath.env`" - elif [ -f /usr/share/${i}/package.env ] ; then - pf=/usr/share/${i}/package.env - addcp=`grep "CLASSPATH=" $pf | sed "s/CLASSPATH=//"` - total="${total}:${addcp}" - else - eerror "Package ${i} not found" - exit 1 - fi - done - echo $total | sed "s/::/:/g" -} - -findpluginpath() { - - # This covers Sun and Blackdown - - rootpath=${JAVA_HOME}/jre/plugin/${PFORM} - - if [ $1 == "ns4" ] || [ $1 == "netscape4" ] ; then - for i in ${rootpath}/{ns4,netscape4}/javaplugin.so ; do - if [ -e $i ] ; then - echo $i - break - fi - done - elif [ $1 == "ns6" ] || [ $1 == "netscape6" ] || [ $1 == "moz" ] || [ $1 == "mozilla" ] ; then - for i in ${rootpath}/{mozilla,ns600,netscape6}/{libjavaplugin_oji,javaplugin_oji}.so ; do - if [ -e $i ] ; then - echo $i - break - fi - done - else - eerror "Browser [$1] unknown" - fi - - # This covers IBM - - rootpath=${JAVA_HOME} - if [ $1 == "ns4" ] || [ $1 == "netscape4" ] ; then - for i in ${rootpath}/{,jre}/bin/javaplugin.so ; do - if [ -e $i ] ; then - echo $i - break - fi - done - elif [ $1 == "ns6" ] || [ $1 == "netscape6" ] || [ $1 == "moz" ] || [ $1 == "mozilla" ] ; then - for i in ${rootpath}/{,jre}/bin/libjavaplugin_oji.so ; do - if [ -e $i ] ; then - echo $i - break - fi - done - fi -} - -function vm_shortname() { - basename $1 | sed -e "s/20//" #-e "s/-[0-9]\..*//" -} - -function vm_version() { - ( . $1 ; echo "$VERSION ($i)" ) -} - -function vm_envvars() { - local file=$1 - local system="$2" - - ( . $file ; - for i in $ENV_VARS ; do - if [ $i == "ADDPATH" ] && [ -z "$system" ]; then - echo "PATH=\${PATH}:${!i}" - elif [ $i == "ADDPATH" ] && [ "$system" ]; then - echo "PATH=${!i}" - echo "ROOTPATH=${!i}" - elif [ $i == "ADDLDPATH" ] ; then - if [ "$system" ]; then - echo "LDPATH=${!i}" - fi - else - echo "${i}=${!i}" - fi - done - ) -} - -function source_java_classpath() { - echo "if [ -f $HOME/.gentoo/java-env-classpath ] ; then" - echo " . $HOME/.gentoo/java-env-classpath" - echo "fi" -} - -function set_vm() { - local vm=$1 - local cfgpath=$2 - local cfgfile=$3 - local system="" - if [ "$cfgpath" == "/etc/env.d" ] ; then - system="yes" - fi - local found="" - - for i in /etc/env.d/java/20*-* ; do - if [ $vm == `vm_shortname $i` ] ; then - echo "Now using `vm_version $i`" - mkdir -p $cfgpath - echo "# Autogenerated by java-config $version" > ${cfgpath}/${cfgfile} - echo "# Cmd: $0 $all_params" >> ${cfgpath}/${cfgfile} - vm_envvars $i $system >> ${cfgpath}/${cfgfile} - if [ -z $system ] ; then - source_java_classpath >> $HOME/.gentoo/java-env - fi - found="yes" - fi - done - if [ -z "$found" ] ; then - echo "$vm not found" - fi -} - -function calc_full_classpath() { - echo "${CLASSPATH}:`classpathfor $1`:." | sed "s/::/:/g" -} - -if [ $# == 0 ] ; then - echo "Usage: java-config [OPTIONS] [LIBRARIES]" - exit 1 -fi - -while test $# -gt 0; do - - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --debug) - set -x - ;; - --browser-plugin=*) - pluginpath=`findpluginpath $optarg` - if [ -n "$pluginpath" ] ; then - echo `basename $pluginpath` - else - eerror "Plugin not found" - fi - ;; - --full-browser-plugin-path=*) - findpluginpath $optarg - ;; - --classpath) - echo ${CLASSPATH} - ;; - --classpath=*) - classpathfor $optarg - ;; - --full-classpath=*) - calc_full_classpath $optarg - ;; - --jdk-home) - echo ${JDK_HOME} - ;; - --jre-home) - echo ${JRE_HOME} - ;; - --javac) - find_exec javac - ;; - --java) - find_exec java - ;; - --jar) - find_exec jar - ;; - --java-version) - `find_exec java` -version - ;; - --exec=*) - find_exec $optarg - ;; - --version) - echo java-config $version - ;; - --list-available-packages) - # Old env var file - for i in /usr/share/*/classpath.env ; do - if [ ! -f $i ] ; then continue ; fi - dn=`dirname $i` - echo "[`basename $dn`] No description ($i)" - done - # New env var file - for i in /usr/share/*/package.env ; do - if [ ! -f $i ] ; then continue ; fi - dn=`dirname $i` - id=`basename $dn` - desc=`grep DESC $i | sed "s/DESCRIPTION=//"` - echo "[${id}] ${desc} ($i)" - done - - ;; - --list-available-vms) - for i in /etc/env.d/java/20*-* ; do - echo "[`vm_shortname $i`] `vm_version $i`" - done - ;; - --set-system-classpath=*) - echo "CLASSPATH=`calc_full_classpath $optarg`" > \ - /etc/env.d/21java-classpath - ;; - --set-user-classpath=*) - mkdir -p $HOME/.gentoo - echo "CLASSPATH=\${CLASSPATH}:`calc_full_classpath $optarg`" > \ - $HOME/.gentoo/java-env-classpath - if [ ! -f $HOME/.gentoo/java-env ] ; then - source_java_classpath > $HOME/.gentoo/java-env - fi - ;; - --set-system-vm=*) - set_vm $optarg /etc/env.d 20java - ;; - --set-user-vm=*) - if [ $UID == 0 ] ; then - eerror "ERROR: root should _always_ use the system-vm" - eerror "NOTE : user-vm for root not set." - else - set_vm $optarg $HOME/.gentoo java-env - fi - ;; - *) - usage - ;; - esac - shift -done diff --git a/dev-java/java-config/java-config-0.2.4-r1.ebuild b/dev-java/java-config/java-config-0.2.4-r1.ebuild deleted file mode 100644 index 50466a9328e0..000000000000 --- a/dev-java/java-config/java-config-0.2.4-r1.ebuild +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright 1999-2002 Gentoo Technologies, Inc. -# Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/java-config-0.2.4-r1.ebuild,v 1.6 2002/08/16 02:46:29 murphy Exp $ - -S=${WORKDIR}/${P} -DESCRIPTION="Gentoo-specific configuration for Java" -SRC_URI="" -HOMEPAGE="http://www.gentoo.org/~karltk/projects/java-config" -DEPEND="" -#RDEPEND="" -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="x86 ppc sparc sparc64" - -src_install () { - dobin ${FILESDIR}/java-config - doman ${FILESDIR}/java-config.1 -} diff --git a/dev-java/java-config/java-config-0.2.5.ebuild b/dev-java/java-config/java-config-0.2.5.ebuild index b7893d3447e4..2589b03e3bef 100644 --- a/dev-java/java-config/java-config-0.2.5.ebuild +++ b/dev-java/java-config/java-config-0.2.5.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2002 Gentoo Technologies, Inc. +# Copyright 2001-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later -# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/java-config-0.2.5.ebuild,v 1.2 2002/09/07 23:47:22 owen Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-java/java-config/java-config-0.2.5.ebuild,v 1.3 2002/09/08 00:22:06 karltk Exp $ S=${WORKDIR}/${P} DESCRIPTION="Gentoo-specific configuration for Java" @@ -13,6 +13,6 @@ SLOT="0" KEYWORDS="x86 ppc sparc sparc64" src_install () { - dobin ${FILESDIR}/java-config - doman ${FILESDIR}/java-config.1 + dobin ${FILESDIR}/${PV}/java-config + doman ${FILESDIR}/${PV}/java-config.1 } |