From c619c76cae1dfaefdb5506cf23349364da97ce7d Mon Sep 17 00:00:00 2001 From: Vlastimil Babka Date: Thu, 26 Apr 2007 14:50:00 +0000 Subject: [PATCH] Fix java-pkg_jar-from() when called with multiple comma-separated packages wrt ensure-dep and build-only. --- eclass/java-utils-2.eclass | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass index 01615826e264..ee9f28ba7d88 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.78 2007/04/24 21:11:41 caster Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.79 2007/04/26 14:50:00 caster Exp $ # ----------------------------------------------------------------------------- @@ -834,7 +834,8 @@ java-pkg_recordjavadoc() # --with-dependencies - get jars also from requested package's dependencies # transitively. # --into $dir - symlink jar(s) into $dir (must exist) instead of . -# @param $1 - Package to get jars from. +# @param $1 - Package to get jars from, or comma-separated list of packages in +# case other parameters are not used. # @param $2 - jar from package. If not specified, all jars will be used. # @param $3 - When a single jar is specified, destination filename of the # symlink. Defaults to the name of the jar. @@ -875,19 +876,23 @@ java-pkg_jar-from() { classpath="$(java-config ${deep} --classpath=${target_pkg})" [[ $? != 0 ]] && die ${error_msg} - java-pkg_ensure-dep "${build_only}" "${target_pkg}" - - pushd ${destdir} > /dev/null \ - || die "failed to change directory to ${destdir}" - # When we have commas this functions is called to bring jars from multiple - # packages. This affects recording of dependencencies because that syntax uses : - # if we don't change them to : gjl and java-config -d -p break + # packages. This affects recording of dependencencies performed later + # which expects one package only, so we do it here. if [[ ${target_pkg} = *,* ]]; then + for pkg in ${target_pkg//,/ }; do + java-pkg_ensure-dep "${build_only}" "${pkg}" + [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${pkg}" + done + # setting this disables further record-jar_ calls later build_only="build" - java-pkg_record-jar_ ${target_pkg//,/:} + else + java-pkg_ensure-dep "${build_only}" "${target_pkg}" fi + pushd ${destdir} > /dev/null \ + || die "failed to change directory to ${destdir}" + local jar for jar in ${classpath//:/ }; do local jar_name=$(basename "${jar}") -- 2.26.2