Add usage warnings to pkg_postinst and pkg_postrm, deprecate pkg_prerm
authorAndreas Hüttel <dilfridge@gentoo.org>
Fri, 21 Nov 2014 01:21:44 +0000 (01:21 +0000)
committerAndreas Hüttel <dilfridge@gentoo.org>
Fri, 21 Nov 2014 01:21:44 +0000 (01:21 +0000)
eclass/ChangeLog
eclass/perl-module.eclass

index cf705842f5d12c7e45b3188178156c880897457e..2c6b7ea66f3ac1c467efd98024004ceddfc203f6 100644 (file)
@@ -1,6 +1,9 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1434 2014/11/20 15:32:09 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1435 2014/11/21 01:21:44 dilfridge Exp $
+
+  21 Nov 2014; Andreas K. Huettel <dilfridge@gentoo.org> perl-module.eclass:
+  Add usage warnings to pkg_postinst and pkg_postrm, deprecate pkg_prerm
 
   20 Nov 2014; Michał Górny <mgorny@gentoo.org> git-2.eclass,
   distutils.eclass, python.eclass, twisted.eclass:
index 5069c03cdb1a2c8cf574f95ac1457a416da183fb..dce0ed5e81d93e3ac7c5ef05a09d348144ec4ebe 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.155 2014/11/19 19:52:06 dilfridge Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.156 2014/11/21 01:21:44 dilfridge Exp $
 
 # @ECLASS: perl-module.eclass
 # @MAINTAINER:
@@ -341,26 +341,44 @@ perl-module_pkg_preinst() {
 # @FUNCTION: perl-module_pkg_postinst
 # @USAGE: perl-module_pkg_postinst
 # @DESCRIPTION:
-# This function is to be called during the pkg_postinst() phase.
+# This function is to be called during the pkg_postinst() phase. It only does 
+# useful things for the perl-core category, where it handles the file renaming and symbolic
+# links that prevent file collisions for dual-life packages installing scripts. 
+# In any other category it immediately exits.
 perl-module_pkg_postinst() {
        debug-print-function $FUNCNAME "$@"
+       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."
+               return 0
+       fi
        perl_link_duallife_scripts
 }
 
 # @FUNCTION: perl-module_pkg_prerm
 # @USAGE: perl-module_pkg_prerm
 # @DESCRIPTION:
-# This function is to be called during the pkg_prerm() phase.
+# This function was to be called during the pkg_prerm() phase.
+# It does not do anything. Deprecated, to be removed.
 perl-module_pkg_prerm() {
        debug-print-function $FUNCNAME "$@"
+       eqawarn "perl-module.eclass: perl-module_pkg_prerm does not do anything and will be removed. Please remove the call."
 }
 
 # @FUNCTION: perl-module_pkg_postrm
 # @USAGE: perl-module_pkg_postrm
 # @DESCRIPTION:
-# This function is to be called during the pkg_postrm() phase.
+# This function is to be called during the pkg_postrm() phase. It only does 
+# useful things for the perl-core category, where it handles the file renaming and symbolic
+# links that prevent file collisions for dual-life packages installing scripts. 
+# In any other category it immediately exits.
 perl-module_pkg_postrm() {
        debug-print-function $FUNCNAME "$@"
+       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."
+               return 0
+       fi
        perl_link_duallife_scripts
 }
 
@@ -528,12 +546,9 @@ perl_rm_files() {
 # @FUNCTION: perl_link_duallife_scripts
 # @USAGE: perl_link_duallife_scripts
 # @DESCRIPTION:
-# This function contains the bulk of perl-module_pkg_postinst()'s logic
-# and will be soon deprecated. 
-#
-# Please use perl-module_pkg_postinst() instead.
-#
-# TODO: Move code to perl-module_pkg_postinst().
+# Moves files and generates symlinks so dual-life packages installing scripts do not
+# lead to file collisions. Mainly for use in pkg_postinst and pkg_postrm, and makes 
+# only sense for perl-core packages.
 perl_link_duallife_scripts() {
        debug-print-function $FUNCNAME "$@"
        if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then