Index: java-utils-2.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v retrieving revision 1.39 diff -u -r1.39 java-utils-2.eclass --- java-utils-2.eclass 3 Jan 2007 09:18:20 -0000 1.39 +++ java-utils-2.eclass 9 Jan 2007 16:12:19 -0000 @@ -1011,13 +1011,36 @@ # export RDEPEND="${RDEPEND} ${depstr}" #} -# This should be used after S has been populated with symlinks to jars -# TODO document +# ------------------------------------------------------------------------------ +# @ebuild-function java-pkg_find-normal-jars +# +# Find the files with suffix .jar file in the given directory or $WORKDIR +# +# @param $1 - The directory to search for jar files (default: ${WORKDIR}) +# ------------------------------------------------------------------------------ +java-pkg_find-normal-jars() { + local dir=$1 + [[ "${dir}" ]] || dir="${WORKDIR}" + local found + for jar in $(find "${dir}" -name "*.jar" -type f); do + echo "${jar}" + found="true" + done + [[ "${found}" ]] + return $? +} + +# ------------------------------------------------------------------------------ +# @ebuild-function java-pkg_ensure-no-bundled-jars +# +# Try to locate bundled jar files in ${WORKDIR} and die if found. +# This function should be called after WORKDIR has been populated with symlink +# to system jar files or bundled jars removed. +# ------------------------------------------------------------------------------ java-pkg_ensure-no-bundled-jars() { debug-print-function ${FUNCNAME} $* - pushd ${WORKDIR} >/dev/null 2>/dev/null - local bundled_jars=$(find . -name "*.jar" -type f) + local bundled_jars=$(java-pkg_find-normal-jars) if [[ -n ${bundled_jars} ]]; then echo "Bundled jars found:" local jar @@ -1025,9 +1048,7 @@ echo $(pwd)${jar/./} done die "Bundled jars found!" - fi - popd >/dev/null 2>/dev/null } # ------------------------------------------------------------------------------ Index: java-pkg-2.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v retrieving revision 1.8 diff -u -r1.8 java-pkg-2.eclass --- java-pkg-2.eclass 18 Dec 2006 10:18:56 -0000 1.8 +++ java-pkg-2.eclass 9 Jan 2007 16:12:19 -0000 @@ -84,6 +84,10 @@ } pre_src_compile() { + if is-java-strict; then + echo "Searching for bundled jars:" + java-pkg_find-normal-jars || echo "None found." + fi java-pkg-2_pkg_setup }