/[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.42 Revision 1.43
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.42 2007/01/15 00:01:21 caster Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.43 2007/01/15 21:03:24 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
181 181
182 java-pkg_check-versioned-jar ${jar_basename} 182 java-pkg_check-versioned-jar ${jar_basename}
183 183
184 # check if it exists 184 # check if it exists
185 if [[ -e "${jar}" ]] ; then 185 if [[ -e "${jar}" ]] ; then
186 # Don't overwrite if jar has already been installed with the same
187 # name
188 local dest="${D}${JAVA_PKG_JARDEST}/${jar_basename}"
189 if [[ -e "${dest}" ]]; then
190 ewarn "Overwriting ${dest}"
191 fi
192
186 # install it into JARDEST if it's a non-symlink 193 # install it into JARDEST if it's a non-symlink
187 if [[ ! -L "${jar}" ]] ; then 194 if [[ ! -L "${jar}" ]] ; then
188 INSDESTTREE="${JAVA_PKG_JARDEST}" \ 195 INSDESTTREE="${JAVA_PKG_JARDEST}" \
189 doins "${jar}" || die "failed to install ${jar}" 196 doins "${jar}" || die "failed to install ${jar}"
190 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}" 197 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}"
730 if [[ "${1}" = "--build-only" ]]; then 737 if [[ "${1}" = "--build-only" ]]; then
731 build_only="true" 738 build_only="true"
732 shift 739 shift
733 fi 740 fi
734 741
742 if [[ "${1}" = "--with-dependencies" ]]; then
743 local deep="--with-dependencies"
744 shift
745 fi
746
735 local target_pkg="${1}" target_jar="${2}" destjar="${3}" 747 local target_pkg="${1}" target_jar="${2}" destjar="${3}"
736 748
737 [[ -z ${target_pkg} ]] && die "Must specify a package" 749 [[ -z ${target_pkg} ]] && die "Must specify a package"
738 750
739 # default destjar to the target jar 751 # default destjar to the target jar
740 [[ -z "${destjar}" ]] && destjar="${target_jar}" 752 [[ -z "${destjar}" ]] && destjar="${target_jar}"
741 753
742 local error_msg="There was a problem getting the classpath for ${target_pkg}." 754 local error_msg="There was a problem getting the classpath for ${target_pkg}."
743 local classpath 755 local classpath
744 classpath="$(java-config --classpath=${target_pkg})" 756 classpath="$(java-config ${deep} --classpath=${target_pkg})"
745 [[ $? != 0 ]] && die ${error_msg} 757 [[ $? != 0 ]] && die ${error_msg}
746 758
747 local jar 759 local jar
748 for jar in ${classpath//:/ }; do 760 for jar in ${classpath//:/ }; do
749 local jar_name=$(basename "${jar}") 761 local jar_name=$(basename "${jar}")
810 if [[ "${1}" = "--build-only" ]]; then 822 if [[ "${1}" = "--build-only" ]]; then
811 local build_only="true" 823 local build_only="true"
812 shift 824 shift
813 fi 825 fi
814 826
827 if [[ "${1}" = "--with-dependencies" ]]; then
828 local deep="--with-dependencies"
829 shift
830 fi
831
815 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --build-only" 832 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --build-only"
816 833
817 local classpath pkgs="${1}" 834 local classpath pkgs="${1}"
818 jars="$(java-config --classpath=${pkgs})" 835 jars="$(java-config ${deep} --classpath=${pkgs})"
819 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed" 836 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
820 debug-print "${pkgs}:${jars}" 837 debug-print "${pkgs}:${jars}"
821 838
822 if [[ -z "${classpath}" ]]; then 839 if [[ -z "${classpath}" ]]; then
823 classpath="${jars}" 840 classpath="${jars}"

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

  ViewVC Help
Powered by ViewVC 1.1.20