From a4788381ed1181d5a24d855aecbd6671a2b05464 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andreas=20H=C3=BCttel?= Date: Fri, 21 Nov 2014 01:21:44 +0000 Subject: [PATCH] Add usage warnings to pkg_postinst and pkg_postrm, deprecate pkg_prerm --- eclass/ChangeLog | 5 ++++- eclass/perl-module.eclass | 35 +++++++++++++++++++++++++---------- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/eclass/ChangeLog b/eclass/ChangeLog index cf705842f5d1..2c6b7ea66f3a 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -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 perl-module.eclass: + Add usage warnings to pkg_postinst and pkg_postrm, deprecate pkg_prerm 20 Nov 2014; Michał Górny git-2.eclass, distutils.eclass, python.eclass, twisted.eclass: diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass index 5069c03cdb1a..dce0ed5e81d9 100644 --- a/eclass/perl-module.eclass +++ b/eclass/perl-module.eclass @@ -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 -- 2.26.2