/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.37 Revision 1.38
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2005, Gentoo Foundation 5# Copyright (c) 2004-2005, Gentoo Foundation
6# 6#
7# Licensed under the GNU General Public License, v2 7# Licensed under the GNU General Public License, v2
8# 8#
9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.37 2006/12/31 01:39:38 caster Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.38 2006/12/31 19:30:54 betelgeuse Exp $
10 10
11 11
12# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
13# @eclass-begin 13# @eclass-begin
14# @eclass-shortdesc Java Utility eclass 14# @eclass-shortdesc Java Utility eclass
256 java-pkg_init_paths_ 256 java-pkg_init_paths_
257 257
258 local jar jar_dir jar_file 258 local jar jar_dir jar_file
259 for jar in "$@"; do 259 for jar in "$@"; do
260 # TODO use java-pkg_check-versioned-jar 260 # TODO use java-pkg_check-versioned-jar
261 if [[ -e "${jar}" ]]; then 261 if [[ -e "${jar}" || -e "${D}${jar}" ]]; then
262 [[ -d "${jar}" || -d "${D}${jar}" ]] \
263 && die "Called ${FUNCNAME} on a directory $*"
262 # nelchael: we should strip ${D} in this case too, here's why: 264 # nelchael: we should strip ${D} in this case too, here's why:
263 # imagine such call: 265 # imagine such call:
264 # java-pkg_regjar ${D}/opt/java/*.jar 266 # java-pkg_regjar ${D}/opt/java/*.jar
265 # such call will fall into this case (-e ${jar}) and will 267 # such call will fall into this case (-e ${jar}) and will
266 # record paths with ${D} in package.env 268 # record paths with ${D} in package.env
267 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
268 elif [[ -e "${D}${jar}" ]]; then
269 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}" 269 java-pkg_append_ JAVA_PKG_CLASSPATH "${jar#${D}}"
270 else 270 else
271 die "${jar} does not exist" 271 die "${jar} does not exist"
272 fi 272 fi
273 done 273 done
575 local var_tmp="${T}/launcher_variables_tmp" 575 local var_tmp="${T}/launcher_variables_tmp"
576 local target_dir pre 576 local target_dir pre
577 577
578 # Process the other the rest of the arguments 578 # Process the other the rest of the arguments
579 while [[ -n "${1}" && -n "${2}" ]]; do 579 while [[ -n "${1}" && -n "${2}" ]]; do
580 local var=${1} value=${2} 580 local var="${1}" value="${2}"
581 if [[ "${var:0:2}" == "--" ]]; then 581 if [[ "${var:0:2}" == "--" ]]; then
582 local var=${var:2} 582 local var=${var:2}
583 echo "gjl_${var}=\"${value}\"" >> "${var_tmp}" 583 echo "gjl_${var}=\"${value}\"" >> "${var_tmp}"
584 local gjl_${var}="${value}" 584 local gjl_${var}="${value}"
585 elif [[ "${var}" == "-into" ]]; then 585 elif [[ "${var}" == "-into" ]]; then
799# (passed to java-config --classpath) 799# (passed to java-config --classpath)
800# ------------------------------------------------------------------------------ 800# ------------------------------------------------------------------------------
801java-pkg_getjars() { 801java-pkg_getjars() {
802 debug-print-function ${FUNCNAME} $* 802 debug-print-function ${FUNCNAME} $*
803 803
804 [[ ${#} -lt 1 || ${#} -gt 2 ]] && die "${FUNCNAME} takes only one or two arguments"
805
806 if [[ "${1}" = "--build-only" ]]; then 804 if [[ "${1}" = "--build-only" ]]; then
807 local build_only="true" 805 local build_only="true"
808 shift 806 shift
809 fi 807 fi
808
809 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --build-only"
810 810
811 local classpath pkgs="${1}" 811 local classpath pkgs="${1}"
812 jars="$(java-config --classpath=${pkgs})" 812 jars="$(java-config --classpath=${pkgs})"
813 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed" 813 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
814 debug-print "${pkgs}:${jars}" 814 debug-print "${pkgs}:${jars}"
1437# ------------------------------------------------------------------------------ 1437# ------------------------------------------------------------------------------
1438use_doc() { 1438use_doc() {
1439 use doc && echo ${@:-javadoc} 1439 use doc && echo ${@:-javadoc}
1440} 1440}
1441 1441
1442
1442# ------------------------------------------------------------------------------ 1443# ------------------------------------------------------------------------------
1443# @section-end build 1444# @section-end build
1444# ------------------------------------------------------------------------------ 1445# ------------------------------------------------------------------------------
1445 1446
1446# ------------------------------------------------------------------------------ 1447# ------------------------------------------------------------------------------
1829# Switch VM if we're allowed to (controlled by JAVA_PKG_ALLOW_VM_CHANGE), and 1830# Switch VM if we're allowed to (controlled by JAVA_PKG_ALLOW_VM_CHANGE), and
1830# verify that the current VM is sufficient. 1831# verify that the current VM is sufficient.
1831# Setup the environment for the VM being used. 1832# Setup the environment for the VM being used.
1832# ------------------------------------------------------------------------------ 1833# ------------------------------------------------------------------------------
1833java-pkg_switch-vm() { 1834java-pkg_switch-vm() {
1835 debug-print-function ${FUNCNAME} $*
1836
1834 if java-pkg_needs-vm; then 1837 if java-pkg_needs-vm; then
1835 # Use the VM specified by JAVA_PKG_FORCE_VM 1838 # Use the VM specified by JAVA_PKG_FORCE_VM
1836 if [[ -n ${JAVA_PKG_FORCE_VM} ]]; then 1839 if [[ -n "${JAVA_PKG_FORCE_VM}" ]]; then
1837 # If you're forcing the VM, I hope you know what your doing... 1840 # If you're forcing the VM, I hope you know what your doing...
1841 debug-print "JAVA_PKG_FORCE_VM used: ${JAVA_PKG_FORCE_VM}"
1838 export GENTOO_VM="${JAVA_PKG_FORCE_VM}" 1842 export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
1839 # if we're allowed to switch the vm... 1843 # if we're allowed to switch the vm...
1840 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then 1844 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
1841 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" 1845 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}"
1842 if [[ -n ${JAVA_PKG_VNEED} ]]; then 1846 if [[ -n ${JAVA_PKG_VNEED} ]]; then

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.20