diff options
author | Petteri Räty <betelgeuse@gentoo.org> | 2007-01-10 09:52:51 +0000 |
---|---|---|
committer | Petteri Räty <betelgeuse@gentoo.org> | 2007-01-10 09:52:51 +0000 |
commit | 31cdb471c591114d375d68a46ad9ff72025b4004 (patch) | |
tree | e4dccd0e954997155367f51a1ecfaf939dca493e /eclass | |
parent | Store --name used by s-s-d in the service daemon file so baselayout-1.13 can (diff) | |
download | gentoo-2-31cdb471c591114d375d68a46ad9ff72025b4004.tar.gz gentoo-2-31cdb471c591114d375d68a46ad9ff72025b4004.tar.bz2 gentoo-2-31cdb471c591114d375d68a46ad9ff72025b4004.zip |
Added to code to automatically show possible bundled jars in pre_src_compile.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/java-pkg-2.eclass | 6 | ||||
-rw-r--r-- | eclass/java-utils-2.eclass | 35 |
2 files changed, 33 insertions, 8 deletions
diff --git a/eclass/java-pkg-2.eclass b/eclass/java-pkg-2.eclass index ddce6ca1c44c..99f3843ccd4a 100644 --- a/eclass/java-pkg-2.eclass +++ b/eclass/java-pkg-2.eclass @@ -5,7 +5,7 @@ # # 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 @@ -84,6 +84,10 @@ pre_src_unpack() { } 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 } diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index 6f0eff9eebac..d8093fbb1ca8 100644 --- a/eclass/java-utils-2.eclass +++ b/eclass/java-utils-2.eclass @@ -6,7 +6,7 @@ # # 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 $ # ----------------------------------------------------------------------------- @@ -1011,13 +1011,36 @@ java-pkg_getjar() { # 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 @@ java-pkg_ensure-no-bundled-jars() { echo $(pwd)${jar/./} done die "Bundled jars found!" - fi - popd >/dev/null 2>/dev/null } # ------------------------------------------------------------------------------ |