diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-12-21 21:41:13 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-12-21 21:41:13 +0000 |
commit | c145769898dedaec2fd5e71f4f24a1d331489e8c (patch) | |
tree | fb58df8938a8a24faca9a72bba270e891cdc1756 /bin/ebuild.sh | |
parent | 24e15b666aae23d800821343e0040ae8ed6fd575 (diff) | |
download | portage-c145769898dedaec2fd5e71f4f24a1d331489e8c.tar.gz portage-c145769898dedaec2fd5e71f4f24a1d331489e8c.tar.bz2 portage-c145769898dedaec2fd5e71f4f24a1d331489e8c.zip |
Add support for the new DEFINED_PHASES metadata key which is automatically generated
from the set of phase functions that are defined by the ebuild and any eclasses it
may have inherited.
svn path=/main/trunk/; revision=12273
Diffstat (limited to 'bin/ebuild.sh')
-rwxr-xr-x | bin/ebuild.sh | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 7b4fa6868..bab8eca2c 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -2053,12 +2053,38 @@ ebuild_main() { auxdbkeys="DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE DESCRIPTION KEYWORDS INHERITED IUSE CDEPEND PDEPEND PROVIDE EAPI - PROPERTIES UNUSED_06 UNUSED_05 UNUSED_04 + PROPERTIES DEFINED_PHASES UNUSED_05 UNUSED_04 UNUSED_03 UNUSED_02 UNUSED_01" #the extra $(echo) commands remove newlines unset CDEPEND [ -n "${EAPI}" ] || EAPI=0 + local eapi=$EAPI + + # alphabetically ordered by $EBUILD_PHASE value + local valid_phases + case $eapi in + 0|1) + valid_phases="src_compile src_install pkg_nofetch + pkg_postinst pkg_postrm pkg_preinst pkg_prerm pkg_setup + src_test src_unpack" + ;; + *) + valid_phases="src_compile src_configure src_install + pkg_nofetch pkg_postinst pkg_postrm pkg_preinst + src_prepare pkg_prerm pkg_setup src_test src_unpack" + ;; + esac + + DEFINED_PHASES= + for f in $valid_phases ; do + if [[ $(type -t $f) = function ]] ; then + f=${f#pkg_} + DEFINED_PHASES+=" ${f#src_}" + fi + done + [[ -n $DEFINED_PHASES ]] || DEFINED_PHASES=- + if [ -n "${dbkey}" ] ; then > "${dbkey}" for f in ${auxdbkeys} ; do |