#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.8 2006/12/18 10:18:56 betelgeuse Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v 1.9 2007/01/10 09:52:51 betelgeuse Exp $
inherit java-utils-2
}
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
}
#
# Licensed under the GNU General Public License, v2
#
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.39 2007/01/03 09:18:20 caster Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.40 2007/01/10 09:52:51 betelgeuse Exp $
# -----------------------------------------------------------------------------
# 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
echo $(pwd)${jar/./}
done
die "Bundled jars found!"
-
fi
- popd >/dev/null 2>/dev/null
}
# ------------------------------------------------------------------------------