commit:     73586f6429fd6ddaec2e32447886f7122cfa5840
Author:     Andreas K. Huettel (dilfridge) <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Nov 28 21:15:52 2015 +0000
Commit:     Andreas Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Dec 19 13:17:07 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73586f64

perl-module.eclass: Allow EAPI=6, ban PERL_EXPORT_PHASE_FUNCTIONS, 
GENTOO_DEPEND_ON_PERL_SUBSLOT, simplify dependency

 eclass/perl-module.eclass | 47 +++++++++++++++++++++++++++++++++++++----------
 1 file changed, 37 insertions(+), 10 deletions(-)

diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 0ef8d3d..f380730 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.eclass
@@ -37,21 +37,48 @@ case "${EAPI:-0}" in
                        RDEPEND="${DEPEND}"
                        ;;
                esac
+
+               case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
+                       yes)
+                               EXPORT_FUNCTIONS ${PERL_EXPF}
+                               ;;
+                       no)
+                               debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
+                               ;;
+                       *)
+                               die 
"PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by 
perl-module.eclass"
+                               ;;
+               esac
                ;;
-       *)
-               die "EAPI=${EAPI} is not supported by perl-module.eclass"
-               ;;
-esac
+       6)
+               [[ ${CATEGORY} == "perl-core" ]] && \
+                       PERL_EXPF+=" pkg_postinst pkg_postrm"
+
+               case "${GENTOO_DEPEND_ON_PERL:-yes}" in
+                       yes)
+                               DEPEND="dev-lang/perl:="
+                               RDEPEND="dev-lang/perl:="
+                               ;;
+                       noslotop)
+                               DEPEND="dev-lang/perl"
+                               RDEPEND="dev-lang/perl"
+                               ;;
+               esac
+
+               if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT}" ]]; then
+                       eerror "GENTOO_DEPEND_ON_PERL_SUBSLOT is banned in 
EAPI=6. If you don't want a slot operator"
+                       die    "set GENTOO_DEPEND_ON_PERL=noslotop instead."
+               fi
+
+               if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
+                       eerror "PERL_EXPORT_PHASE_FUNCTIONS is banned in 
EAPI=6. Use perl-module.eclass if you need"
+                       die    "phase functions, perl-functions.eclass if not."
+               fi
 
-case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
-       yes)
                EXPORT_FUNCTIONS ${PERL_EXPF}
                ;;
-       no)
-               debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
-               ;;
        *)
-               die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} 
is not supported by perl-module.eclass"
+               die "EAPI=${EAPI} is not supported by perl-module.eclass"
                ;;
 esac
 

Reply via email to