Add a TODO note about adding a registration interface for eclasses to register
authorZac Medico <zmedico@gentoo.org>
Mon, 15 Mar 2010 00:25:57 +0000 (00:25 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 15 Mar 2010 00:25:57 +0000 (00:25 -0000)
phase hooks, in order to migrate away from global scope useq() calls.

svn path=/main/trunk/; revision=15829

bin/ebuild.sh

index 60c8f5e2297ecf8bc1ec54f1ad05d919f0c88563..1e9f7dc3f9895f151d81de4ed0c2a6a541767a3f 100755 (executable)
@@ -134,12 +134,13 @@ useq() {
        fi
 
        if [[ $EBUILD_PHASE = depend ]] ; then
-               # Skip this for older EAPIs since lots of ebuilds/eclasses
-               # have stuff in global scope that really belongs somewhere
-               # like pkg_setup or src_configure.
-               if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 3 3_pre2 ; then
-                       die "use() called during invalid phase: $EBUILD_PHASE"
-               fi
+               # TODO: Add a registration interface for eclasses to register
+               # any number of phase hooks, so that global scope eclass
+               # initialization can by migrated to phase hooks in new EAPIs.
+               # Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
+               #if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 3 ; then
+               #       die "use() called during invalid phase: $EBUILD_PHASE"
+               #fi
 
        # Make sure we have this USE flag in IUSE
        elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then