summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Fredric <kentfredric@gmail.com>2012-02-16 17:11:43 +1300
committerKent Fredric <kentfredric@gmail.com>2012-02-16 17:11:43 +1300
commit5eaae8ce158ced41542b52875a536d228f4e29ee (patch)
tree2f51f26327ac3a55c52f369dfaa21724955c549f /eclass/perl-module.eclass
parentreplace die calls with perl_fatal_error to force the display of a custom mess... (diff)
downloadperl-overlay-5eaae8ce158ced41542b52875a536d228f4e29ee.tar.gz
perl-overlay-5eaae8ce158ced41542b52875a536d228f4e29ee.tar.bz2
perl-overlay-5eaae8ce158ced41542b52875a536d228f4e29ee.zip
[perl-module.eclass] work around the absolutely insane failure handling system EAPI4 introduces
Diffstat (limited to 'eclass/perl-module.eclass')
-rw-r--r--eclass/perl-module.eclass35
1 files changed, 31 insertions, 4 deletions
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 22c8543c8..bdda6995f 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.eclass
@@ -109,10 +109,37 @@ perl_diagnostics() {
fi
}
+perl_nonfatal() {
+ # This is an awful hack because
+ # a) EAPI <4 are fatal
+ # b) EAPI >4 are nonfatal
+ # c) There's no way to get EAPI<4 behaviour without the 'nonfatal' pragma
+ # d) The 'nonfatal' pragma is banned from EAPI<4
+ # e) The underlying implementation of the nonfatal pragma is PM Specific
+ # * Portage uses PORAGE_FATAL=1
+ # * Paludis uses PALUDIS_FAILURE_IS_NONFATAL=yes
+ # f) Arrrghh.
+ # -- kentfredric@gmail.com
+ local exitcond
+ if has "${EAPI:-0}" 0 1 2 3 3_pre2 ; then
+ if [[ $# -lt 1 ]]; then
+ die "$FUNCNAME(): Missing argument"
+ fi
+ "$@"
+ return $?
+ fi
+ nonfatal "$@"
+}
+
perl_fatal_error() {
debug-print-function $FUNCNAME "$@"
perl_diagnostics;
- eerror "Please attach the contents of $(perl_diagfile) with your bug report";
+ eerror "-- Gentoo Perl Team Specific Bug reporting request -- "
+ eerror ""
+ eerror "Please attach the contents of the following file with your bug report:";
+ eerror ""
+ eerror " $(perl_diagfile)"
+ eerror ""
die "$@"
}
perl-module_src_unpack() {
@@ -208,7 +235,7 @@ perl-module_src_compile() {
OTHERLDFLAGS="${LDFLAGS}" \
"${mymake_local[@]}"
einfo "emake" "$@"
- emake "$@" \
+ perl_nonfatal emake "$@" \
|| perl_fatal_error "Compilation failed"
# OPTIMIZE="${CFLAGS}" \
fi
@@ -313,7 +340,7 @@ perl-module_src_test() {
if [[ -f Build ]] ; then
./Build test verbose=${TEST_VERBOSE:-0} || perl_fatal_error "test failed"
elif [[ -f Makefile ]] ; then
- emake test TEST_VERBOSE=${TEST_VERBOSE:-0} || perl_fatal_error "test failed"
+ perl_nonfatal emake test TEST_VERBOSE=${TEST_VERBOSE:-0} || perl_fatal_error "test failed"
else
ewarn "No ./Build or ./Makefile, can not run tests"
fi
@@ -345,7 +372,7 @@ perl-module_src_install() {
./Build ${mytargets} \
|| perl_fatal_error "./Build ${mytargets} failed"
elif [[ -f Makefile ]] ; then
- emake "${myinst_local[@]}" ${mytargets} \
+ perl_nonfatal emake "${myinst_local[@]}" ${mytargets} \
|| perl_fatal_error "emake ${myinst_local[@]} ${mytargets} failed"
fi