public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Kent Fredric" <kentfredric@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/perl-overlay:eclass-moretests commit in: eclass/
Date: Thu, 16 Feb 2012 04:11:50 +0000 (UTC)	[thread overview]
Message-ID: <1329365503.5eaae8ce158ced41542b52875a536d228f4e29ee.kent@gentoo> (raw)

commit:     5eaae8ce158ced41542b52875a536d228f4e29ee
Author:     Kent Fredric <kentfredric <AT> gmail <DOT> com>
AuthorDate: Thu Feb 16 04:11:43 2012 +0000
Commit:     Kent Fredric <kentfredric <AT> gmail <DOT> com>
CommitDate: Thu Feb 16 04:11:43 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/perl-overlay.git;a=commit;h=5eaae8ce

[perl-module.eclass] work around the absolutely insane failure handling system EAPI4 introduces

---
 eclass/perl-module.eclass |   35 +++++++++++++++++++++++++++++++----
 1 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 22c8543..bdda699 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
 



             reply	other threads:[~2012-02-16  4:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  4:11 Kent Fredric [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-02-21 20:16 [gentoo-commits] proj/perl-overlay:eclass-moretests commit in: eclass/ Torsten Veller
2012-02-16  5:22 Kent Fredric
2012-02-16  3:16 Kent Fredric
2012-02-16  0:28 Kent Fredric
2012-02-16  0:28 Kent Fredric

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1329365503.5eaae8ce158ced41542b52875a536d228f4e29ee.kent@gentoo \
    --to=kentfredric@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox