/[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.54 Revision 1.55
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.54 2007/01/29 18:37:24 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.55 2007/01/30 12:50:25 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
227 ewarn "Overwriting ${dest}" 227 ewarn "Overwriting ${dest}"
228 fi 228 fi
229 229
230 # install it into JARDEST if it's a non-symlink 230 # install it into JARDEST if it's a non-symlink
231 if [[ ! -L "${jar}" ]] ; then 231 if [[ ! -L "${jar}" ]] ; then
232 #but first check class version when in strict mode.
233 is-java-strict && java-pkg_verify-classes "${jar}"
234
232 INSDESTTREE="${JAVA_PKG_JARDEST}" \ 235 INSDESTTREE="${JAVA_PKG_JARDEST}" \
233 doins "${jar}" || die "failed to install ${jar}" 236 doins "${jar}" || die "failed to install ${jar}"
234 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}" 237 java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}"
235 debug-print "installed ${jar} to ${D}${JAVA_PKG_JARDEST}" 238 debug-print "installed ${jar} to ${D}${JAVA_PKG_JARDEST}"
236 # make a symlink to the original jar if it's symlink 239 # make a symlink to the original jar if it's symlink
303 for jar in "${@}"; do 306 for jar in "${@}"; do
304 # TODO use java-pkg_check-versioned-jar 307 # TODO use java-pkg_check-versioned-jar
305 if [[ -e "${jar}" || -e "${D}${jar}" ]]; then 308 if [[ -e "${jar}" || -e "${D}${jar}" ]]; then
306 [[ -d "${jar}" || -d "${D}${jar}" ]] \ 309 [[ -d "${jar}" || -d "${D}${jar}" ]] \
307 && die "Called ${FUNCNAME} on a directory $*" 310 && die "Called ${FUNCNAME} on a directory $*"
311
312 #check that class version correct when in strict mode
313 is-java-strict && java-pkg_verify-classes "${jar}"
314
308 # nelchael: we should strip ${D} in this case too, here's why: 315 # nelchael: we should strip ${D} in this case too, here's why:
309 # imagine such call: 316 # imagine such call:
310 # java-pkg_regjar ${D}/opt/java/*.jar 317 # java-pkg_regjar ${D}/opt/java/*.jar
311 # such call will fall into this case (-e ${jar}) and will 318 # such call will fall into this case (-e ${jar}) and will
312 # record paths with ${D} in package.env 319 # record paths with ${D} in package.env
2207 fi 2214 fi
2208} 2215}
2209 2216
2210# TODO document 2217# TODO document
2211# Verify that the classes were compiled for the right source / target 2218# Verify that the classes were compiled for the right source / target
2219# If $1 is present will check that file otherwise the ${D} directory
2220# recursively.
2212java-pkg_verify-classes() { 2221java-pkg_verify-classes() {
2213 ebegin "Verifying java class versions"
2214 #$(find ${D} -type f -name '*.jar' -o -name '*.class') 2222 #$(find ${D} -type f -name '*.jar' -o -name '*.class')
2223 local target=$(java-pkg_get-target)
2224 ebegin "Verifying java class versions (target: ${target})"
2225 if [[ -n "${1}" ]]; then
2226 class-version-verify.py -t ${target} "${1}"
2227 else
2215 class-version-verify.py -t $(java-pkg_get-target) -r ${D} 2228 class-version-verify.py -t ${target} -r "${D}"
2229 fi
2216 result=$? 2230 result=$?
2217 eend ${result} 2231 eend ${result}
2218 if [[ ${result} == 0 ]]; then 2232 if [[ ${result} != 0 ]]; then
2219 einfo "All good"
2220 else
2221 ewarn "Possible problem" 2233 ewarn "Possible problem"
2222 die "Bad class files found" 2234 die "Bad class files found"
2223 fi 2235 fi
2224} 2236}
2225 2237

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.55

  ViewVC Help
Powered by ViewVC 1.1.20