From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 202A21389E2 for ; Tue, 23 Dec 2014 18:19:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B4EEEE06CC; Tue, 23 Dec 2014 18:19:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3CE8DE06CC for ; Tue, 23 Dec 2014 18:19:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1733634031E for ; Tue, 23 Dec 2014 18:19:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B975AD35A for ; Tue, 23 Dec 2014 18:19:09 +0000 (UTC) From: "Kent Fredric" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kent Fredric" Message-ID: <1419356766.c008440b0904162ae204b26c98e9bd07f958a107.kent@gentoo> Subject: [gentoo-commits] proj/perl-overlay:master commit in: eclass/ X-VCS-Repository: proj/perl-overlay X-VCS-Files: eclass/perl-module.eclass X-VCS-Directories: eclass/ X-VCS-Committer: kent X-VCS-Committer-Name: Kent Fredric X-VCS-Revision: c008440b0904162ae204b26c98e9bd07f958a107 X-VCS-Branch: master Date: Tue, 23 Dec 2014 18:19:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a2376249-cbd1-4dfb-8f77-f61148a1591a X-Archives-Hash: 3f7d419a51e17988d4c5dd9d7297f378 commit: c008440b0904162ae204b26c98e9bd07f958a107 Author: Kent Fredric gmail com> AuthorDate: Tue Dec 23 17:44:36 2014 +0000 Commit: Kent Fredric gmail com> CommitDate: Tue Dec 23 17:46:06 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/perl-overlay.git;a=commit;h=c008440b perl-module.eclass: move PERLQAFATAL handling to its own function and extend its featureset --- eclass/perl-module.eclass | 42 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass index df4f87f..70f7d0f 100644 --- a/eclass/perl-module.eclass +++ b/eclass/perl-module.eclass @@ -20,6 +20,7 @@ PERL_EXPF="src_unpack src_compile src_test src_install" case "${EAPI:-0}" in 0|1) eqawarn "$P: EAPI 0 and 1 are deprecated both in ::gentoo and ::perl-experimental" + perl_qafatal "eapi"; PERL_EXPF+=" pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm" ;; 2|3|4|5) @@ -148,10 +149,7 @@ perl-module_src_configure() { if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it." eqawarn " Add virtual/perl-Module-Build to DEPEND!" - if [[ -n ${PERLQAFATAL} ]]; then - eerror "Bailing out due to PERLQAFATAL=1"; - die; - fi + perl_qafatal "modulebuild" fi set -- \ --installdirs=vendor \ @@ -386,6 +384,7 @@ perl-module_pkg_postinst() { if [[ ${CATEGORY} != perl-core ]] ; then eqawarn "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category." eqawarn " This does not do anything; the call can be safely removed." + perl_qafatal "function" return 0 fi perl_link_duallife_scripts @@ -413,6 +412,7 @@ perl-module_pkg_postrm() { if [[ ${CATEGORY} != perl-core ]] ; then eqawarn "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category." eqawarn " This does not do anything; the call can be safely removed." + perl_qafatal "function" return 0 fi perl_link_duallife_scripts @@ -460,6 +460,7 @@ perl_check_module_version() { if [[ -n ${REAL_PV} && ${REAL_PV} != ${PV} ]] ; then eqawarn "QA Notice: Based on MODULE_VERSION=${MODULE_VERSION} the ebuild version ${PV} is wrong!" eqawarn " The ebuild version should be ${REAL_PV}" + perl_qafatal "version" fi } @@ -672,6 +673,39 @@ perl_link_duallife_scripts() { fi } +# @FUNCTION: perl_qafatal +# @USAGE: perl_qafatal TYPE +# @DESCRIPTION: +# Invoking this method after eqawarn's allows an entry point for the eclass to trigger +# a fatal exit if the user has PERL_QAFATAL set. +# +# The value TYPE will be used to optionally allow the user to filter certain QA Types. +# TYPE = eapi : Legacy EAPI warnings +# TYPE = modulebuild : Failure to include Module-Build as a dependency. +# TYPE = modulebuildtiny : Failure to include Module-Build-Tiny as a dependency +# TYPE = function : Use of a deprecated function +# TYPE = version : version and expected version missmatch +# +# PERL_QAFATAL: +# == "1" - Fatal for all types +# has "all" - Fatal for all types +# has "$type" - Fatal for "$type" +perl_qafatal() { + local failtype=$1 + if [[ "${PERLQAFATAL:-0}" == 1 ]]; then + eerror "Bailing out due to PERLQAFATAL including $failtype (==1)"; + die; + fi + if has 'all' ${PERLQAFATAL}; then + eerror "Bailing out due to PERLQAFATAL including $failtype (all)"; + die; + fi + if has $failtype ${PERLQAFATAL}; then + eerror "Bailing out due to PERLQAFATAL including $1"; + die; + fi +} + perl_set_eprefix() { debug-print-function $FUNCNAME "$@" case ${EAPI:-0} in