Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 126747 Details for
Bug 163262
java gen-2 eclasses probably could stop relying on phase hooks
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
no-hooks.patch
no-hooks.patch (text/plain), 8.51 KB, created by
Petteri Räty (RETIRED)
on 2007-08-02 21:16:30 UTC
(
hide
)
Description:
no-hooks.patch
Filename:
MIME Type:
Creator:
Petteri Räty (RETIRED)
Created:
2007-08-02 21:16:30 UTC
Size:
8.51 KB
patch
obsolete
>Index: java-ant-2.eclass >=================================================================== >RCS file: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v >retrieving revision 1.22 >diff -u -r1.22 java-ant-2.eclass >--- java-ant-2.eclass 1 Jun 2007 12:49:03 -0000 1.22 >+++ java-ant-2.eclass 2 Aug 2007 21:11:48 -0000 >@@ -126,33 +126,12 @@ > JAVA_PKG_BSFIX_SOURCE_TAGS=${JAVA_PKG_BSFIX_SOURCE_TAGS:-"javadoc javac xjavac javac.preset"} > > # ------------------------------------------------------------------------------ >-# @public java-ant_src_unpack >+# @global JAVA_ANT_IGNORE_SYSTEM_CLASSES > # >-# Unpacks the source, and attempts to fix build files. >-# variable JAVA_ANT_IGNORE_SYSTEM_CLASSES: >-# ignore ant classpath in available tasks >-# ------------------------------------------------------------------------------ >-post_src_unpack() { >- if java-pkg_func-exists ant_src_unpack; then >- die "ant_src_unpack is no longer support, should use just src_unpack" >- fi >- java-ant_bsfix >- [[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" ]] \ >- && java-ant_ignore-system-classes "${S}/build.xml" >-} >- >-# ------------------------------------------------------------------------------ >-# @private ant_src_unpack >+# Rewrites available tasks to ignore ant classpath. > # >-# Helper function which does the actual unpacking >+# default: off > # ------------------------------------------------------------------------------ >-# TODO maybe use base.eclass for some patching love? >-#ant_src_unpack() { >-# debug-print-function ${FUNCNAME} $* >-# if [[ -n "${A}" ]]; then >-# unpack ${A} >-# fi >-#} > > # ------------------------------------------------------------------------------ > # @private java-ant_bsfix >Index: java-pkg-2.eclass >=================================================================== >RCS file: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v >retrieving revision 1.23 >diff -u -r1.23 java-pkg-2.eclass >--- java-pkg-2.eclass 17 May 2007 21:04:43 -0000 1.23 >+++ java-pkg-2.eclass 2 Aug 2007 21:11:49 -0000 >@@ -89,49 +89,5 @@ > } > > # ------------------------------------------------------------------------------ >-# @note >-# >-# We need to initialize the environment in every function because Portage >-# will source /etc/profile between phases and trample all over the env. >-# This is accomplished by phase hooks, which is available with newer versions of >-# portage. >-# ------------------------------------------------------------------------------ >- >-pre_pkg_setup() { >- java-pkg-2_pkg_setup >-} >- >-pre_src_unpack() { >- java-pkg-2_pkg_setup >-} >- >-pre_src_compile() { >- if is-java-strict; then >- echo "Searching for bundled jars:" >- java-pkg_find-normal-jars || echo "None found." >- echo "Searching for bundled classes (no output if none found):" >- find "${WORKDIR}" -name "*.class" >- echo "Search done." >- fi >- java-pkg-2_pkg_setup >-} >- >-pre_src_install() { >- java-pkg-2_pkg_setup >-} >- >-pre_src_test() { >- java-pkg-2_pkg_setup >-} >- >-pre_pkg_preinst() { >- java-pkg-2_pkg_setup >-} >- >-pre_pkg_postinst() { >- java-pkg-2_pkg_setup >-} >- >-# ------------------------------------------------------------------------------ > # @eclass-end > # ------------------------------------------------------------------------------ >Index: java-utils-2.eclass >=================================================================== >RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v >retrieving revision 1.91 >diff -u -r1.91 java-utils-2.eclass >--- java-utils-2.eclass 20 Jul 2007 18:36:02 -0000 1.91 >+++ java-utils-2.eclass 2 Aug 2007 21:11:49 -0000 >@@ -59,10 +59,11 @@ > # ----------------------------------------------------------------------------- > # @variable-internal JAVA_PKG_PORTAGE_DEP > # >-# The version of portage we need to function properly. At this moment it's >-# portage with phase hooks support. >+# The version of portage we need to function properly. Previously it was >+# portage with phase hooks support but now we use a version with proper env >+# saving. > # ----------------------------------------------------------------------------- >-JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1_pre1" >+JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1.2.7" > > # ----------------------------------------------------------------------------- > # @variable-internal JAVA_PKG_E_DEPEND >@@ -1781,11 +1820,36 @@ > # EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the > # gentoo.classpath property. Be sure to call > # java-ant_rewrite-classpath in src_unpack. >+# JAVA_PKG_NO_BUNDLED_SEARCH - Don't search for bundled jars or class files > # *ANT_TASKS - used to determine ANT_TASKS before calling Ant. > # ------------------------------------------------------------------------------ > eant() { > debug-print-function ${FUNCNAME} $* > >+ if [[ ${EBUILD_PHASE} = compile ]]; then >+ # Used to be done in hooks in java-ant-2.eclass but moved here so that we can >+ # finally get rid of the hooks without breaking stuff >+ >+ [[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" && "${JAVA_PKG_BSFIX}" ]] \ >+ && java-ant_ignore-system-classes "${S}/build.xml" >+ >+ if hasq java-ant-2 ${INHERITED}; then >+ java-ant_bsfix >+ fi >+ >+ # eant can be called multiple times >+ JAVA_PKG_BSFIX="off" >+ >+ if [[ -z ${JAVA_PKG_NO_BUNDLED_SEARCH} ]] && is-java-strict; then >+ echo "Searching for bundled jars:" >+ java-pkg_find-normal-jars || echo "None found." >+ echo "Searching for bundled classes (no output if none found):" >+ find "${WORKDIR}" -name "*.class" >+ echo "Search done." >+ JAVA_PKG_NO_BUNDLED_SEARCH=true # eant can be called many times >+ fi >+ fi >+ > if ! hasq java-ant-2 ${INHERITED}; then > local msg="You should inherit java-ant-2 when using eant" > java-pkg_announce-qa-violation "${msg}" >@@ -1797,7 +1861,6 @@ > local compiler="${GENTOO_COMPILER}" > > local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" >- > local build_compiler="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER})" > if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then > die "ANT_BUILD_COMPILER undefined in ${compiler_env}" >@@ -2018,6 +2081,10 @@ > I_WANT_GLOBAL_JAVA_OPTIONS="true" > fi > >+ if java-pkg_func-exists ant_src_unpack; then >+ java-pkg_announce-qa-violation "Using old ant_src_unpack. Should be src_unpack" >+ fi >+ > java-pkg_init_paths_ > java-pkg_switch-vm > PATH=${JAVA_HOME}/bin:${PATH} >@@ -2464,14 +2531,11 @@ > java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)" > > local tann="${T}/announced-vm" >+ # With the hooks we should only get here once from pkg_setup but better safe than sorry >+ # if people have for example modified eclasses some where > if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then >- # Add a check for setup/preinst phase... to avoid duplicate outputs >- # for when FEATURES=buildpkg >- if [[ ${EBUILD_PHASE} != "setup" && ${EBUILD_PHASE} != "preinst" && ${EBUILD_PHASE} != "postinst" ]]; >- then >- einfo "Using: $(java-config -f)" >- [[ ! -f "${tann}" ]] && touch "${tann}" >- fi >+ einfo "Using: $(java-config -f)" >+ [[ ! -f "${tann}" ]] && touch "${tann}" > fi > > else >Index: java-pkg-opt-2.eclass >=================================================================== >RCS file: /var/cvsroot/gentoo-x86/eclass/java-pkg-opt-2.eclass,v >retrieving revision 1.5 >diff -u -r1.5 java-pkg-opt-2.eclass >--- java-pkg-opt-2.eclass 3 Dec 2006 13:05:06 -0000 1.5 >+++ java-pkg-opt-2.eclass 2 Aug 2007 21:11:49 -0000 >@@ -5,6 +5,11 @@ > # > # Licensed under the GNU General Public License, v2 > # >+# Major changes: >+# 20070401: >+# Removed phase hooks because Portage does proper env saving now. >+# <betelgeuse@gentoo.org> >+# > # $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg-opt-2.eclass,v 1.5 2006/12/03 13:05:06 betelgeuse Exp $ > > inherit java-utils-2 >@@ -37,41 +42,3 @@ > java-pkg-opt-2_pkg_setup() { > use ${JAVA_PKG_OPT_USE} && java-pkg_init > } >- >-# ------------------------------------------------------------------------------ >-# @note >-# >-# We need to initialize the environment in every function because Portage >-# will source /etc/profile between phases and trample all over the env. >-# This is accomplished by phase hooks, which is available with newer versions of >-# portage. >-# ------------------------------------------------------------------------------ >- >-pre_pkg_setup() { >- java-pkg-opt-2_pkg_setup >-} >- >-pre_src_unpack() { >- java-pkg-opt-2_pkg_setup >- use "${JAVA_PKG_OPT_USE}" || JAVA_PKG_BSFIX="off" >-} >- >-pre_src_compile() { >- java-pkg-opt-2_pkg_setup >-} >- >-pre_src_install() { >- java-pkg-opt-2_pkg_setup >-} >- >-pre_src_test() { >- java-pkg-opt-2_pkg_setup >-} >- >-pre_pkg_preinst() { >- java-pkg-opt-2_pkg_setup >-} >- >-pre_pkg_postinst() { >- java-pkg-opt-2_pkg_setup >-}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 163262
: 126747