monsieurp 14/11/01 22:08:54 Modified: perl-module.eclass Log: Introducing perl_rm_files() function. See #520756.
Revision Changes Path 1.145 eclass/perl-module.eclass file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/perl-module.eclass?rev=1.145&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/perl-module.eclass?rev=1.145&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/perl-module.eclass?r1=1.144&r2=1.145 Index: perl-module.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v retrieving revision 1.144 retrieving revision 1.145 diff -u -r1.144 -r1.145 --- perl-module.eclass 1 Nov 2014 17:34:28 -0000 1.144 +++ perl-module.eclass 1 Nov 2014 22:08:54 -0000 1.145 @@ -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.144 2014/11/01 17:34:28 dilfridge Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.145 2014/11/01 22:08:54 monsieurp Exp $ # @ECLASS: perl-module.eclass # @MAINTAINER: @@ -122,6 +122,10 @@ [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}" debug-print "$FUNCNAME: applying user patches" epatch_user + if [[ ${PERL_RM_FILES[@]} ]]; then + debug-print "$FUNCNAME: stripping unneeded files" + perl_rm_files "${PERL_RM_FILES[@]}" + fi perl_fix_osx_extra esvn_clean } @@ -398,6 +402,42 @@ done } +# @FUNCTION: perl_rm_files +# @USAGE: perl_rm_files "file_1" "file_2" +# @DESCRIPTION: +# Remove certain files from a Perl release and remove them from the MANIFEST +# while we're there. +# +# Most useful in src_prepare for nuking bad tests, and is highly recommended +# for any tests like 'pod.t', 'pod-coverage.t' or 'kwalitee.t', as what they +# test is completely irrelevant to end users, and frequently fail simply +# because the authors of Test::Pod... changed their recommendations, and thus +# failures are only useful feedback to Authors, not users. +# +# Removing from MANIFEST also avoids needless log messages warning +# users about files "missing from their kit". +perl_rm_files() { + debug-print-function $FUNCNAME "$@" + local skipfile="${T}/.gentoo_makefile_skip" + local manifile="${S}/MANIFEST" + local manitemp="${T}/.gentoo_manifest_temp" + oldifs="$IFS" + IFS="\n" + for filename in "$@"; do + einfo "Removing un-needed ${filename}"; + # Remove the file + rm -f "${S}/${filename}" + [[ -e "${manifile}" ]] && echo "${filename}" >> "${skipfile}" + done + if [[ -e "${manifile}" && -e "${skipfile}" ]]; then + einfo "Fixing Manifest" + grep -v -F -f "${skipfile}" "${manifile}" > "${manitemp}" + mv -f -- "${manitemp}" "${manifile}" + rm -- "${skipfile}"; + fi + IFS="$oldifs" +} + perl_link_duallife_scripts() { debug-print-function $FUNCNAME "$@" if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then
