/[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.69 Revision 1.70
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.69 2007/04/07 08:52:46 vapier Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.70 2007/04/17 09:16:22 ali_bush 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
861 local error_msg="There was a problem getting the classpath for ${target_pkg}." 861 local error_msg="There was a problem getting the classpath for ${target_pkg}."
862 local classpath 862 local classpath
863 classpath="$(java-config ${deep} --classpath=${target_pkg})" 863 classpath="$(java-config ${deep} --classpath=${target_pkg})"
864 [[ $? != 0 ]] && die ${error_msg} 864 [[ $? != 0 ]] && die ${error_msg}
865 865
866 java-pkg_ensure-dep "${build_only}" "${target_pkg}"
867
866 pushd ${destdir} > /dev/null \ 868 pushd ${destdir} > /dev/null \
867 || die "failed to change directory to ${destdir}" 869 || die "failed to change directory to ${destdir}"
868 870
869 # When we have commas this functions is called to bring jars from multiple 871 # When we have commas this functions is called to bring jars from multiple
870 # packages. This affects recording of dependencencies because that syntax uses : 872 # packages. This affects recording of dependencencies because that syntax uses :
958 shift 960 shift
959 done 961 done
960 962
961 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*" 963 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*"
962 964
965
963 local classpath pkgs="${1}" 966 local classpath pkgs="${1}"
964 jars="$(java-config ${deep} --classpath=${pkgs})" 967 jars="$(java-config ${deep} --classpath=${pkgs})"
965 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed" 968 [[ $? != 0 || -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
966 debug-print "${pkgs}:${jars}" 969 debug-print "${pkgs}:${jars}"
970
971 for pkg in "${pkgs//,/ }"; do
972 java-pkg_ensure-dep "${build_only}" "${pkg}"
973 done
967 974
968 if [[ -z "${classpath}" ]]; then 975 if [[ -z "${classpath}" ]]; then
969 classpath="${jars}" 976 classpath="${jars}"
970 else 977 else
971 classpath="${classpath}:${jars}" 978 classpath="${classpath}:${jars}"
1027 1034
1028 local error_msg="Could not find classpath for ${pkg}. Are you sure its installed?" 1035 local error_msg="Could not find classpath for ${pkg}. Are you sure its installed?"
1029 local classpath 1036 local classpath
1030 classpath=$(java-config --classpath=${pkg}) 1037 classpath=$(java-config --classpath=${pkg})
1031 [[ $? != 0 ]] && die ${error_msg} 1038 [[ $? != 0 ]] && die ${error_msg}
1039
1040 java-pkg_ensure-dep "${build_only}" "${pkg}"
1032 1041
1033 for jar in ${classpath//:/ }; do 1042 for jar in ${classpath//:/ }; do
1034 if [[ ! -f "${jar}" ]] ; then 1043 if [[ ! -f "${jar}" ]] ; then
1035 die "Installation problem with jar ${jar} in ${pkg} - is it installed?" 1044 die "Installation problem with jar ${jar} in ${pkg} - is it installed?"
1036 fi 1045 fi
2332 eerror "See ${log} for more details." 2341 eerror "See ${log} for more details."
2333 die "Incorrect bytecode found" 2342 die "Incorrect bytecode found"
2334 fi 2343 fi
2335} 2344}
2336 2345
2346# ----------------------------------------------------------------------------
2347# @internal-function java-pkg_ensure-dep
2348# Check that a package being used in jarfrom, getjars and getjar is contained
2349# within DEPEND or RDEPEND.
2350# @param $1 - Is the package a runtime dependency
2351# @param $2 - Package name and slot.
2352
2353java-pkg_ensure-dep() {
2354 debug-print-function ${FUNCNAME} $*
2355
2356 local build_only="${1}"
2357 local target_pkg="${2}"
2358 local dev_error=""
2359
2360 local stripped_pkg=$(echo "${target_pkg}" | sed \
2361 's/-[0-9]*\(\.[0-9]\)*$//')
2362
2363 if [[ ! ( "${DEPEND}" =~ "$stripped_pkg" ) ]]; then
2364 dev_error="The ebuild is attempting to use ${target_pkg} that is not"
2365 dev_error="${dev_error} declared in DEPEND."
2366 if is-java-strict; then
2367 die "${dev_error}"
2368 else
2369 eerror "${dev_error}"
2370 einfo "Because you have this package installed the package will"
2371 einfo "build without problems, but please report this to"
2372 einfo "http://bugs.gentoo.org"
2373 fi
2374 fi
2375
2376 if [[ -z ${build_only} && ! ( ${RDEPEND} =~ "${stripped_pkg}" ) ]]; then
2377 dev_error="The ebuild is attempting to use ${target_pkg},"
2378 dev_error="${dev_error} without specifying --build-only, that is not declared in RDEPEND."
2379 if is-java-strict; then
2380 die "${error}"
2381 else
2382 eerror "${dev_error}"
2383 einfo "Because you have this package installed the package will"
2384 einfo "build without problems, but please report this to"
2385 einfo "http://bugs.gentoo.org"
2386 fi
2387 fi
2388}
2389
2337# ------------------------------------------------------------------------------ 2390# ------------------------------------------------------------------------------
2338# @section-end internal 2391# @section-end internal
2339# ------------------------------------------------------------------------------ 2392# ------------------------------------------------------------------------------
2340 2393
2341java-pkg_check-phase() { 2394java-pkg_check-phase() {

Legend:
Removed from v.1.69  
changed lines
  Added in v.1.70

  ViewVC Help
Powered by ViewVC 1.1.20