/[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.55 Revision 1.56
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.55 2007/01/30 12:50:25 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.56 2007/01/30 14:12:34 caster 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
2212 einfo "Classes" 2212 einfo "Classes"
2213 find "${S}" -type f -name '*.class' -print0 | xargs -0 -r -n 500 ls -ald | sed -e "s,${WORKDIR},\${WORKDIR}," 2213 find "${S}" -type f -name '*.class' -print0 | xargs -0 -r -n 500 ls -ald | sed -e "s,${WORKDIR},\${WORKDIR},"
2214 fi 2214 fi
2215} 2215}
2216 2216
2217# TODO document 2217# ------------------------------------------------------------------------------
2218# @internal-function java-pkg_verify-classes
2219#
2218# Verify that the classes were compiled for the right source / target 2220# Verify that the classes were compiled for the right source / target. Dies if
2219# If $1 is present will check that file otherwise the ${D} directory 2221# not.
2220# recursively. 2222# @param $1 (optional) - the file to check, otherwise checks whole ${D}
2223# ------------------------------------------------------------------------------
2221java-pkg_verify-classes() { 2224java-pkg_verify-classes() {
2222 #$(find ${D} -type f -name '*.jar' -o -name '*.class') 2225 #$(find ${D} -type f -name '*.jar' -o -name '*.class')
2223 local target=$(java-pkg_get-target) 2226 local target=$(java-pkg_get-target)
2224 ebegin "Verifying java class versions (target: ${target})" 2227 local result
2228 local log="${T}/class-version-verify.log"
2225 if [[ -n "${1}" ]]; then 2229 if [[ -n "${1}" ]]; then
2226 class-version-verify.py -t ${target} "${1}" 2230 class-version-verify.py -v -t ${target} "${1}" > "${log}"
2231 result=$?
2227 else 2232 else
2233 ebegin "Verifying java class versions (target: ${target})"
2228 class-version-verify.py -t ${target} -r "${D}" 2234 class-version-verify.py -v -t ${target} -r "${D}" > "${log}"
2229 fi
2230 result=$? 2235 result=$?
2231 eend ${result} 2236 eend ${result}
2237 fi
2238 [[ -n ${JAVA_PKG_DEBUG} ]] && cat "${log}"
2232 if [[ ${result} != 0 ]]; then 2239 if [[ ${result} != 0 ]]; then
2233 ewarn "Possible problem" 2240 eerror "Incorrect bytecode version found"
2234 die "Bad class files found" 2241 [[ -n "${1}" ]] && eerror "in file: ${1}"
2242 eerror "See ${log} for more details."
2243 die "Incorrect bytecode found"
2235 fi 2244 fi
2236} 2245}
2237 2246
2238# ------------------------------------------------------------------------------ 2247# ------------------------------------------------------------------------------
2239# @section-end internal 2248# @section-end internal

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

  ViewVC Help
Powered by ViewVC 1.1.20