wrt bug https://bugs.gentoo.org/627440 there is a need to update java eclasses to use correctly both current path and the new path. the attached patch should provide that. i also attached updated ebuild with the new path. in the patch i also removed the old "/usr/bin/..." path which is not used anymore.

i tested that on some ebuilds and all works fine.

any comments and suggestions welcome.

fordfrog

diff --git a/eclass/java-ant-2.eclass b/eclass/java-ant-2.eclass
index 1fd4feb39134..5be76953edd6 100644
--- a/eclass/java-ant-2.eclass
+++ b/eclass/java-ant-2.eclass
@@ -224,8 +224,13 @@ java-ant_bsfix_files() {
 			files+=( -f "${file}" )
 		done
 
-		local rewriter3="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
-		local rewriter4="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite"
+		if [ -e "${EPREFIX}/usr/libexec/javatoolkit" ]; then
+			local rewriter3="${EPREFIX}/usr/libexec/javatoolkit/xml-rewrite-3.py"
+			local rewriter4="${EPREFIX}/usr/libexec/javatoolkit/build-xml-rewrite"
+		else
+			local rewriter3="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
+			local rewriter4="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite"
+		fi
 
 		if [[ -x ${rewriter4} && ${JAVA_ANT_ENCODING} ]]; then
 			[[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] && local gcp="-g"
@@ -375,11 +380,11 @@ java-ant_ignore-system-classes() {
 # @DESCRIPTION:
 # Run the right xml-rewrite binary with the given arguments
 java-ant_xml-rewrite() {
-	local gen2="${EPREFIX}/usr/bin/xml-rewrite-2.py"
 	local gen2_1="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-2.py"
+	local gen2_2="${EPREFIX}/usr/libexec/javatoolkit/xml-rewrite-2.py"
 	# gen1 is deprecated
-	if [[ -x "${gen2}" ]]; then
-		${gen2} "${@}" || die "${gen2} failed"
+	if [[ -x "${gen2_2}" ]]; then
+		${gen2_2} "${@}" || die "${gen2_2} failed"
 	elif [[ -x "${gen2_1}" ]]; then
 		${gen2_1} "${@}" || die "${gen2_1} failed"
 	else
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index 4f7eb0356fc9..e32cb572f147 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -2729,10 +2729,13 @@ java-pkg_jar-list() {
 java-pkg_verify-classes() {
 	#$(find ${D} -type f -name '*.jar' -o -name '*.class')
 
-	local version_verify="/usr/bin/class-version-verify.py"
+	local version_verify_1="${EPREFIX}/usr/$(get_libdir)/javatoolkit/bin/class-version-verify.py"
+	local version_verify_2="${EPREFIX}/usr/libexec/javatoolkit/class-version-verify.py"
 
-	if [[ ! -x "${version_verify}" ]]; then
-		version_verify="/usr/$(get_libdir)/javatoolkit/bin/class-version-verify.py"
+	if [[ -x "${version_verify_1}" ]]; then
+		local version_verify=${version_verify_1}
+	else
+		local version_verify=${version_verify_2}
 	fi
 
 	if [[ ! -x "${version_verify}" ]]; then
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
PYTHON_REQ_USE="xml(+)"

inherit distutils-r1 multilib prefix

DESCRIPTION="Collection of Gentoo-specific tools for Java"
HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Java";
SRC_URI="https://gitweb.gentoo.org/proj/${PN}.git/snapshot/${P}.tar.bz2";

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~sparc ~x86 ~ppc-aix ~amd64-linux 
~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris 
~x64-solaris ~x86-solaris"

python_prepare_all() {
        hprefixify src/py/buildparser src/py/findclass setup.py
        distutils-r1_python_prepare_all
}

python_install() {
        distutils-r1_python_install \
                --install-scripts="${EPREFIX}"/usr/libexec/${PN}
}

Reply via email to