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:master commit in: eclass/
Date: Sun, 15 Mar 2015 05:10:26 +0000 (UTC)	[thread overview]
Message-ID: <1426395864.5f8e66084195ff46a00c8e86fe0ce9c734e026e9.kent@gentoo> (raw)

commit:     5f8e66084195ff46a00c8e86fe0ce9c734e026e9
Author:     Kent Fredric <kentfredric <AT> gmail <DOT> com>
AuthorDate: Sun Mar 15 05:04:24 2015 +0000
Commit:     Kent Fredric <kentfredric <AT> gmail <DOT> com>
CommitDate: Sun Mar 15 05:04:24 2015 +0000
URL:        https://gitweb.gentoo.org/proj/perl-overlay.git/commit/?id=5f8e6608

[perl-module.eclass] make perl_qawarn invocations have clearer errors under PERL_QAFATAL

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

diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index dcf8620..f71753e 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.eclass
@@ -20,7 +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_qafatal "eapi" "EAPI 0 and 1 are deprecated";
 		PERL_EXPF+=" pkg_setup pkg_preinst pkg_postinst pkg_prerm pkg_postrm"
 		;;
 	2|3|4|5)
@@ -152,14 +152,14 @@ perl-module_src_configure() {
 			if [[ ${DEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
 				eqawarn "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."
 				eqawarn "           Add dev-perl/Module-Build-Tiny to DEPEND!"
-				perl_qafatal "modulebuildtiny"
+				perl_qafatal "modulebuildtiny" "Needs to depend on Module-Build-Tiny"
 			fi
 		else
 			einfo "Using Module::Build"
 			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!"
-				perl_qafatal "modulebuild"
+				perl_qafatal "modulebuild" "Needs to depend on Module-Build"
 			fi
 		fi
 		set -- \
@@ -394,7 +394,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"
+		perl_qafatal "function" "$FUNCNAME is private to perl-core"
 		return 0
 	fi
 	perl_link_duallife_scripts
@@ -422,7 +422,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"
+		perl_qafatal "function" "$FUNCNAME is private to perl-core"
 		return 0
 	fi
 	perl_link_duallife_scripts
@@ -470,7 +470,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"
+		perl_qafatal "version" "${REAL_PV} != ${PV}"
 	fi
 }
 
@@ -658,33 +658,49 @@ perl_link_duallife_scripts() {
 
 	perl_set_eprefix
 
-	local i ff
+	local i ff execdir mandir
+
+	execdir="usr/share/perl-${P}/bin"
+	mandir="usr/share/perl-${P}/man/man1"
+
 	if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
 		for i in "${DUALLIFESCRIPTS[@]}" ; do
+			alternatives_auto_makesym "/${i}-${PV}"	"${EROOT}${execdir}/${i##*/}"
 			alternatives_auto_makesym "/${i}" "/${i}-[0-9]*"
 		done
 		for i in "${DUALLIFEMAN[@]}" ; do
-			ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*`
+			# Expand $i to a full path as it was installed,
+			# which may add .gz or whatever to the end during compress.
+			# then boil it till you just get ".gz"
+			ff="${EROOT}${mandir}/${i##*/}";
+			ff=$( echo ${ff%.1}.1* );
 			ff=${ff##*.1}
-			alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*"
+			alternatives_auto_makesym "/${i%.1}-${PV}.1${ff}" "${EROOT}${mandir}/${i##*/}${ff}"
+			alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*.1${ff}"
 		done
 	else
 		pushd "${ED}" > /dev/null
 		for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do
-			mv ${i}{,-${PV}-${P}} || die
+			mkdir -p "${D}/${execdir}" || die
+			mv ${i} "${D}/${execdir}/${i##*/}" || die
 			#DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}
 			DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i}
 		done
 		for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null) ; do
-			mv ${i} ${i%.1}-${PV}-${P}.1 || die
+			mkdir -p "${D}/${mandir}" || die
+			mv ${i} "${D}/${mandir}/${i##*/}" || die
 			DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i}
 		done
+
+		einfo "Cleaning empty directories"
+		perl_trim_empty_dirs "${EROOT}/usr/bin"
+
 		popd > /dev/null
 	fi
 }
 
 # @FUNCTION: perl_qafatal
-# @USAGE: perl_qafatal TYPE
+# @USAGE: perl_qafatal TYPE "Die reason"
 # @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.
@@ -702,17 +718,18 @@ perl_link_duallife_scripts() {
 #  has "$type" 	- Fatal for "$type"
 perl_qafatal() {
 	local failtype=$1
+	local failreason=$2
 	if [[ "${PERLQAFATAL:-0}" == 1 ]]; then
 		eerror "Bailing out due to PERLQAFATAL including $failtype (==1)";
-		die;
+		die "$failtype: $failreason"
 	fi
 	if has 'all' ${PERLQAFATAL}; then
 		eerror "Bailing out due to PERLQAFATAL including $failtype (all)";
-		die;
+		die "$failtype: $failreason"
 	fi
 	if has $failtype ${PERLQAFATAL}; then
 		eerror "Bailing out due to PERLQAFATAL including $1";
-		die;
+		die "$failtype: $failreason"
 	fi
 }
 


             reply	other threads:[~2015-03-15  5:10 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15  5:10 Kent Fredric [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-09-17  0:51 [gentoo-commits] proj/perl-overlay:master commit in: eclass/ Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2017-09-17  0:51 Kent Fredric
2015-06-25  1:26 Kent Fredric
2015-06-21  0:39 Kent Fredric
2015-06-21  0:39 Kent Fredric
2015-06-20 22:13 Kent Fredric
2015-06-20 22:13 Kent Fredric
2015-06-20 22:13 Kent Fredric
2015-06-20 22:13 Kent Fredric
2015-03-26 12:14 Kent Fredric
2015-03-15 17:06 Kent Fredric
2015-03-15  5:10 Kent Fredric
2014-12-23 18:19 Kent Fredric
2014-12-23 18:19 Kent Fredric
2014-12-23 14:43 Kent Fredric
2014-10-11 18:46 Kent Fredric
2014-10-11 18:46 Kent Fredric
2014-10-11 18:46 Kent Fredric
2014-08-26 19:06 Kent Fredric
2014-08-24 13:56 Kent Fredric
2014-08-20 13:24 Kent Fredric
2014-04-04 23:09 Kent Fredric
2013-09-17  4:35 Kent Fredric
2013-09-17  4:28 Kent Fredric
2013-04-28 16:53 Kent Fredric
2012-09-15 16:58 Torsten Veller
2012-06-07  6:06 Torsten Veller
2012-06-05 18:22 Torsten Veller
2012-06-05 18:22 Torsten Veller
2012-04-23 13:04 Torsten Veller
2012-04-23 13:04 Torsten Veller
2012-04-23 13:04 Torsten Veller
2011-08-16 17:02 Torsten Veller
2011-04-24  8:37 Torsten Veller
2011-02-04  8:15 tove

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=1426395864.5f8e66084195ff46a00c8e86fe0ce9c734e026e9.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