#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.37 2006/12/31 01:39:38 caster Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.38 2006/12/31 19:30:54 betelgeuse Exp $
# -----------------------------------------------------------------------------
local jar jar_dir jar_file
for jar in "$@"; do
# TODO use java-pkg_check-versioned-jar
- if [[ -e "${jar}" ]]; then
+ if [[ -e "${jar}" || -e "${D}${jar}" ]]; then
+ [[ -d "${jar}" || -d "${D}${jar}" ]] \
+ && die "Called ${FUNCNAME} on a directory $*"
# nelchael: we should strip ${D} in this case too, here's why:
# imagine such call:
# java-pkg_regjar ${D}/opt/java/*.jar
# such call will fall into this case (-e ${jar}) and will
# record paths with ${D} in package.env
java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
- elif [[ -e "${D}${jar}" ]]; then
- java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
else
die "${jar} does not exist"
fi
# Process the other the rest of the arguments
while [[ -n "${1}" && -n "${2}" ]]; do
- local var=${1} value=${2}
+ local var="${1}" value="${2}"
if [[ "${var:0:2}" == "--" ]]; then
local var=${var:2}
echo "gjl_${var}=\"${value}\"" >> "${var_tmp}"
java-pkg_getjars() {
debug-print-function ${FUNCNAME} $*
- [[ ${#} -lt 1 || ${#} -gt 2 ]] && die "${FUNCNAME} takes only one or two arguments"
-
if [[ "${1}" = "--build-only" ]]; then
local build_only="true"
shift
fi
+ [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --build-only"
+
local classpath pkgs="${1}"
jars="$(java-config --classpath=${pkgs})"
[[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
use doc && echo ${@:-javadoc}
}
+
# ------------------------------------------------------------------------------
# @section-end build
# ------------------------------------------------------------------------------
# Setup the environment for the VM being used.
# ------------------------------------------------------------------------------
java-pkg_switch-vm() {
+ debug-print-function ${FUNCNAME} $*
+
if java-pkg_needs-vm; then
# Use the VM specified by JAVA_PKG_FORCE_VM
- if [[ -n ${JAVA_PKG_FORCE_VM} ]]; then
+ if [[ -n "${JAVA_PKG_FORCE_VM}" ]]; then
# If you're forcing the VM, I hope you know what your doing...
+ debug-print "JAVA_PKG_FORCE_VM used: ${JAVA_PKG_FORCE_VM}"
export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
# if we're allowed to switch the vm...
elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then