/[gentoo-x86]/eclass/perl-module.eclass
Gentoo

Contents of /eclass/perl-module.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.166 - (hide annotations) (download)
Sat Jun 13 19:01:10 2015 UTC (17 months, 3 weeks ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Changes since 1.165: +3 -3 lines
Allow dev-perl/Module-Build in QA check for Module::Build

1 dilfridge 1.162 # Copyright 1999-2015 Gentoo Foundation
2 vapier 1.30 # Distributed under the terms of the GNU General Public License v2
3 dilfridge 1.166 # $Header: /var/cvsroot/gentoo-x86/eclass/perl-module.eclass,v 1.165 2015/05/25 18:18:00 dilfridge Exp $
4 tove 1.113
5     # @ECLASS: perl-module.eclass
6     # @MAINTAINER:
7     # perl@gentoo.org
8 vapier 1.131 # @AUTHOR:
9     # Seemant Kulleen <seemant@gentoo.org>
10 tove 1.113 # @BLURB: eclass for perl modules
11     # @DESCRIPTION:
12 seemant 1.1 # The perl-module eclass is designed to allow easier installation of perl
13     # modules, and their incorporation into the Gentoo Linux system.
14 seemant 1.3
15 zlogene 1.139 inherit eutils multiprocessing unpacker
16 tove 1.124 [[ ${CATEGORY} == "perl-core" ]] && inherit alternatives
17 tove 1.117
18 dilfridge 1.161 PERL_EXPF="src_unpack src_prepare src_configure src_compile src_test src_install"
19 tove 1.113
20     case "${EAPI:-0}" in
21 dilfridge 1.162 5)
22 tove 1.117 [[ ${CATEGORY} == "perl-core" ]] && \
23 tove 1.124 PERL_EXPF+=" pkg_postinst pkg_postrm"
24 tove 1.113
25     case "${GENTOO_DEPEND_ON_PERL:-yes}" in
26 dilfridge 1.138 yes)
27 dilfridge 1.162 case "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" in
28     yes)
29     DEPEND="dev-lang/perl:=[-build(-)]"
30 dilfridge 1.138 ;;
31     *)
32 dilfridge 1.162 DEPEND="dev-lang/perl[-build(-)]"
33 tove 1.113 ;;
34 dilfridge 1.138 esac
35     RDEPEND="${DEPEND}"
36     ;;
37 tove 1.113 esac
38     ;;
39 tove 1.123 *)
40 tove 1.127 die "EAPI=${EAPI} is not supported by perl-module.eclass"
41 tove 1.123 ;;
42 tove 1.113 esac
43 danarmak 1.13
44 tove 1.124 case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
45     yes)
46     EXPORT_FUNCTIONS ${PERL_EXPF}
47     ;;
48     no)
49     debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
50     ;;
51     *)
52 tove 1.127 die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
53 tove 1.124 ;;
54     esac
55 tove 1.117
56 dilfridge 1.158 LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"
57 robbat2 1.109
58 tove 1.127 if [[ -n ${MY_PN} || -n ${MY_PV} || -n ${MODULE_VERSION} ]] ; then
59     : ${MY_P:=${MY_PN:-${PN}}-${MY_PV:-${MODULE_VERSION:-${PV}}}}
60     S=${MY_S:-${WORKDIR}/${MY_P}}
61     fi
62 tove 1.130
63 robbat2 1.128 [[ -z "${SRC_URI}" && -z "${MODULE_A}" ]] && \
64     MODULE_A="${MY_P:-${P}}.${MODULE_A_EXT:-tar.gz}"
65 tove 1.113 [[ -z "${SRC_URI}" && -n "${MODULE_AUTHOR}" ]] && \
66 tove 1.123 SRC_URI="mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MODULE_SECTION:+${MODULE_SECTION}/}${MODULE_A}"
67 tove 1.113 [[ -z "${HOMEPAGE}" ]] && \
68 tove 1.118 HOMEPAGE="http://search.cpan.org/dist/${MY_PN:-${PN}}/"
69 mcummings 1.66
70 azarah 1.11 SRC_PREP="no"
71 rac 1.55 SRC_TEST="skip"
72 mcummings 1.97 PREFER_BUILDPL="yes"
73 azarah 1.11
74 mcummings 1.101 pm_echovar=""
75 tove 1.113 perlinfo_done=false
76 seemant 1.35
77 monsieurp 1.150 # @FUNCTION: perl-module_src_unpack
78     # @USAGE: perl-module_src_unpack
79     # @DESCRIPTION:
80     # Unpack the ebuild tarball(s).
81     # This function is to be called during the ebuild src_unpack() phase.
82 mcummings 1.102 perl-module_src_unpack() {
83 tove 1.123 debug-print-function $FUNCNAME "$@"
84 dilfridge 1.141
85 zlogene 1.139 unpacker_src_unpack
86 tove 1.113 }
87    
88 monsieurp 1.150 # @FUNCTION: perl-module_src_prepare
89     # @USAGE: perl-module_src_prepare
90     # @DESCRIPTION:
91     # Get the ebuild sources ready.
92     # This function is to be called during the ebuild src_prepare() phase.
93 tove 1.113 perl-module_src_prepare() {
94 tove 1.123 debug-print-function $FUNCNAME "$@"
95 zlogene 1.139 [[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
96     debug-print "$FUNCNAME: applying user patches"
97     epatch_user
98 monsieurp 1.145 if [[ ${PERL_RM_FILES[@]} ]]; then
99     debug-print "$FUNCNAME: stripping unneeded files"
100     perl_rm_files "${PERL_RM_FILES[@]}"
101     fi
102 tove 1.123 perl_fix_osx_extra
103 tove 1.113 esvn_clean
104     }
105    
106 monsieurp 1.150 # @FUNCTION: perl-module_src_configure
107     # @USAGE: perl-module_src_configure
108     # @DESCRIPTION:
109     # Configure the ebuild sources.
110     # This function is to be called during the ebuild src_configure() phase.
111 tove 1.113 perl-module_src_configure() {
112 tove 1.123 debug-print-function $FUNCNAME "$@"
113 mcummings 1.102
114 tove 1.117 [[ ${SRC_PREP} = yes ]] && return 0
115 tove 1.113 SRC_PREP="yes"
116 rac 1.60
117 dilfridge 1.164 perl_check_env
118    
119 tove 1.123 perl_set_version
120 rac 1.60
121 tove 1.130 [[ -z ${pm_echovar} ]] && export PERL_MM_USE_DEFAULT=1
122 mcummings 1.90 # Disable ExtUtils::AutoInstall from prompting
123     export PERL_EXTUTILS_AUTOINSTALL="--skipdeps"
124 rac 1.64
125 tove 1.127 if [[ $(declare -p myconf 2>&-) != "declare -a myconf="* ]]; then
126     local myconf_local=(${myconf})
127     else
128     local myconf_local=("${myconf[@]}")
129     fi
130    
131     if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
132 dilfridge 1.164 if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
133     einfo "Using Module::Build::Tiny"
134     if [[ ${DEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
135     eqawarn "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."
136     eqawarn " Add dev-perl/Module-Build-Tiny to DEPEND!"
137     if [[ -n ${PERLQAFATAL} ]]; then
138     eerror "Bailing out due to PERLQAFATAL=1";
139     die
140     fi
141     fi
142     else
143     einfo "Using Module::Build"
144 dilfridge 1.166 if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${DEPEND} != *dev-perl/Module-Build* && ${PN} != Module-Build ]] ; then
145 dilfridge 1.164 eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
146 dilfridge 1.166 eqawarn " Add dev-perl/Module-Build to DEPEND!"
147 dilfridge 1.164 if [[ -n ${PERLQAFATAL} ]]; then
148     eerror "Bailing out due to PERLQAFATAL=1";
149     die
150     fi
151 tove 1.127 fi
152 tove 1.120 fi
153 tove 1.123 set -- \
154 tove 1.113 --installdirs=vendor \
155     --libdoc= \
156     --destdir="${D}" \
157     --create_packlist=0 \
158 tove 1.127 "${myconf_local[@]}"
159 tove 1.123 einfo "perl Build.PL" "$@"
160     perl Build.PL "$@" <<< "${pm_echovar}" \
161 tove 1.127 || die "Unable to build!"
162 tove 1.113 elif [[ -f Makefile.PL ]] ; then
163 mcummings 1.85 einfo "Using ExtUtils::MakeMaker"
164 tove 1.123 set -- \
165     PREFIX=${EPREFIX}/usr \
166 tove 1.113 INSTALLDIRS=vendor \
167     INSTALLMAN3DIR='none' \
168     DESTDIR="${D}" \
169 tove 1.127 "${myconf_local[@]}"
170 tove 1.123 einfo "perl Makefile.PL" "$@"
171     perl Makefile.PL "$@" <<< "${pm_echovar}" \
172 tove 1.127 || die "Unable to build!"
173 mcummings 1.88 fi
174 tove 1.113 if [[ ! -f Build.PL && ! -f Makefile.PL ]] ; then
175 mcummings 1.88 einfo "No Make or Build file detected..."
176 mcummings 1.85 return
177 mcummings 1.43 fi
178 azarah 1.11 }
179    
180 monsieurp 1.150 # @FUNCTION: perl-module_src_compile
181     # @USAGE: perl-module_src_compile
182     # @DESCRIPTION:
183     # Compile the ebuild sources.
184     # This function is to be called during the ebuild src_compile() phase.
185 aliz 1.15 perl-module_src_compile() {
186 tove 1.123 debug-print-function $FUNCNAME "$@"
187     perl_set_version
188 tove 1.113
189 tove 1.127 if [[ $(declare -p mymake 2>&-) != "declare -a mymake="* ]]; then
190     local mymake_local=(${mymake})
191     else
192     local mymake_local=("${mymake[@]}")
193     fi
194    
195 tove 1.113 if [[ -f Build ]] ; then
196     ./Build build \
197 tove 1.127 || die "Compilation failed"
198 tove 1.113 elif [[ -f Makefile ]] ; then
199 tove 1.127 set -- \
200 tove 1.113 OTHERLDFLAGS="${LDFLAGS}" \
201 tove 1.127 "${mymake_local[@]}"
202     einfo "emake" "$@"
203     emake "$@" \
204     || die "Compilation failed"
205 tove 1.113 # OPTIMIZE="${CFLAGS}" \
206 mcummings 1.43 fi
207 seemant 1.8 }
208    
209 monsieurp 1.150 # @FUNCTION: perl-module_src-test
210     # @USAGE: perl-module_src_test()
211     # @DESCRIPTION:
212     # This code attempts to work out your threadingness from MAKEOPTS
213     # and apply them to Test::Harness.
214 tove 1.117 #
215 monsieurp 1.150 # If you want more verbose testing, set TEST_VERBOSE=1
216     # in your bashrc | /etc/portage/make.conf | ENV
217 tove 1.117 #
218 monsieurp 1.150 # or ebuild writers:
219     # If you wish to enable default tests w/ 'make test' ,
220 tove 1.117 #
221 monsieurp 1.150 # SRC_TEST="do"
222 tove 1.117 #
223 monsieurp 1.150 # If you wish to have threads run in parallel ( using the users makeopts )
224     # all of the following have been tested to work.
225 tove 1.117 #
226 monsieurp 1.150 # SRC_TEST="do parallel"
227     # SRC_TEST="parallel"
228     # SRC_TEST="parallel do"
229     # SRC_TEST=parallel
230 tove 1.117 #
231 aliz 1.15 perl-module_src_test() {
232 tove 1.123 debug-print-function $FUNCNAME "$@"
233 tove 1.117 if has 'do' ${SRC_TEST} || has 'parallel' ${SRC_TEST} ; then
234     if has "${TEST_VERBOSE:-0}" 0 && has 'parallel' ${SRC_TEST} ; then
235 vapier 1.132 export HARNESS_OPTIONS=j$(makeopts_jobs)
236     einfo "Test::Harness Jobs=$(makeopts_jobs)"
237 tove 1.117 fi
238 tove 1.123 ${perlinfo_done} || perl_set_version
239 tove 1.113 if [[ -f Build ]] ; then
240 tove 1.117 ./Build test verbose=${TEST_VERBOSE:-0} || die "test failed"
241 tove 1.113 elif [[ -f Makefile ]] ; then
242 tove 1.117 emake test TEST_VERBOSE=${TEST_VERBOSE:-0} || die "test failed"
243 mcummings 1.68 fi
244 mcummings 1.43 fi
245 seemant 1.1 }
246    
247 monsieurp 1.150 # @FUNCTION: perl-module_src_install
248     # @USAGE: perl-module_src_install
249     # @DESCRIPTION:
250     # Install a Perl ebuild.
251     # This function is to be called during the ebuild src_install() phase.
252 aliz 1.15 perl-module_src_install() {
253 tove 1.123 debug-print-function $FUNCNAME "$@"
254    
255     perl_set_version
256    
257 tove 1.113 local f
258 swegener 1.76
259 dilfridge 1.164 if [[ -f Build ]]; then
260     mytargets="${mytargets:-install}"
261     mbparams="${mbparams:---pure}"
262     einfo "./Build ${mytargets} ${mbparams}"
263     ./Build ${mytargets} ${mbparams} \
264     || die "./Build ${mytargets} ${mbparams} failed"
265     elif [[ -f Makefile ]]; then
266 tove 1.114 case "${CATEGORY}" in
267     dev-perl|perl-core) mytargets="pure_install" ;;
268     *) mytargets="install" ;;
269     esac
270 dilfridge 1.164 if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then
271     local myinst_local=(${myinst})
272     else
273     local myinst_local=("${myinst[@]}")
274     fi
275 tove 1.127 emake "${myinst_local[@]}" ${mytargets} \
276     || die "emake ${myinst_local[@]} ${mytargets} failed"
277 tove 1.113 fi
278    
279 tove 1.123 perl_delete_module_manpages
280     perl_delete_localpod
281     perl_delete_packlist
282     perl_remove_temppath
283 mcummings 1.20
284 tove 1.123 for f in Change* CHANGES README* TODO FAQ ${mydoc}; do
285 tove 1.117 [[ -s ${f} ]] && dodoc ${f}
286 mcummings 1.98 done
287 mcummings 1.65
288 tove 1.123 perl_link_duallife_scripts
289 seemant 1.35 }
290    
291 monsieurp 1.150 # @FUNCTION: perl-module_pkg_postinst
292     # @USAGE: perl-module_pkg_postinst
293     # @DESCRIPTION:
294 dilfridge 1.156 # This function is to be called during the pkg_postinst() phase. It only does
295     # useful things for the perl-core category, where it handles the file renaming and symbolic
296     # links that prevent file collisions for dual-life packages installing scripts.
297     # In any other category it immediately exits.
298 tove 1.117 perl-module_pkg_postinst() {
299 tove 1.123 debug-print-function $FUNCNAME "$@"
300 dilfridge 1.156 if [[ ${CATEGORY} != perl-core ]] ; then
301     eqawarn "perl-module.eclass: You are calling perl-module_pkg_postinst outside the perl-core category."
302     eqawarn " This does not do anything; the call can be safely removed."
303     return 0
304     fi
305 tove 1.123 perl_link_duallife_scripts
306 tove 1.117 }
307 seemant 1.35
308 monsieurp 1.150 # @FUNCTION: perl-module_pkg_postrm
309     # @USAGE: perl-module_pkg_postrm
310     # @DESCRIPTION:
311 dilfridge 1.156 # This function is to be called during the pkg_postrm() phase. It only does
312     # useful things for the perl-core category, where it handles the file renaming and symbolic
313     # links that prevent file collisions for dual-life packages installing scripts.
314     # In any other category it immediately exits.
315 tove 1.117 perl-module_pkg_postrm() {
316 tove 1.123 debug-print-function $FUNCNAME "$@"
317 dilfridge 1.156 if [[ ${CATEGORY} != perl-core ]] ; then
318     eqawarn "perl-module.eclass: You are calling perl-module_pkg_postrm outside the perl-core category."
319     eqawarn " This does not do anything; the call can be safely removed."
320     return 0
321     fi
322 tove 1.123 perl_link_duallife_scripts
323 tove 1.117 }
324 tove 1.124
325 dilfridge 1.148 # @FUNCTION: perl_set_version
326     # @USAGE: perl_set_version
327     # @DESCRIPTION:
328     # Extract version information and installation paths from the current Perl
329     # interpreter.
330     #
331     # This sets the following variables: PERL_VERSION, SITE_ARCH, SITE_LIB,
332     # ARCH_LIB, VENDOR_LIB, VENDOR_ARCH
333     #
334     # This function used to be called perlinfo as well.
335 tove 1.124 perl_set_version() {
336     debug-print-function $FUNCNAME "$@"
337     debug-print "$FUNCNAME: perlinfo_done=${perlinfo_done}"
338     ${perlinfo_done} && return 0
339     perlinfo_done=true
340    
341     local f version install{{site,vendor}{arch,lib},archlib}
342     eval "$(perl -V:{version,install{{site,vendor}{arch,lib},archlib}} )"
343     PERL_VERSION=${version}
344     SITE_ARCH=${installsitearch}
345     SITE_LIB=${installsitelib}
346     ARCH_LIB=${installarchlib}
347     VENDOR_LIB=${installvendorlib}
348     VENDOR_ARCH=${installvendorarch}
349     }
350    
351 dilfridge 1.148 # @FUNCTION: perl_delete_localpod
352     # @USAGE: perl_delete_localpod
353     # @DESCRIPTION:
354     # Remove stray perllocal.pod files in the temporary install directory D.
355     #
356     # This function used to be called fixlocalpod as well.
357 tove 1.124 perl_delete_localpod() {
358     debug-print-function $FUNCNAME "$@"
359    
360     find "${D}" -type f -name perllocal.pod -delete
361     find "${D}" -depth -mindepth 1 -type d -empty -delete
362     }
363    
364 monsieurp 1.149 # @FUNCTION: perl_fix_osx_extra
365     # @USAGE: perl_fix_osx_extra
366     # @DESCRIPTION:
367 monsieurp 1.150 # Look through ${S} for AppleDouble encoded files and get rid of them.
368 tove 1.124 perl_fix_osx_extra() {
369     debug-print-function $FUNCNAME "$@"
370    
371     local f
372     find "${S}" -type f -name "._*" -print0 | while read -rd '' f ; do
373     einfo "Removing AppleDouble encoded Macintosh file: ${f#${S}/}"
374     rm -f "${f}"
375     f=${f#${S}/}
376     grep -q "${f}" "${S}"/MANIFEST && \
377     elog "AppleDouble encoded Macintosh file in MANIFEST: ${f#${S}/}"
378     done
379     }
380    
381 monsieurp 1.149 # @FUNCTION: perl_delete_module_manpages
382     # @USAGE: perl_delete_module_manpages
383 monsieurp 1.150 # @DESCRIPTION:
384 monsieurp 1.149 # Bump off manpages installed by the current module such as *.3pm files as well
385     # as empty directories.
386 tove 1.124 perl_delete_module_manpages() {
387     debug-print-function $FUNCNAME "$@"
388    
389     if [[ -d "${ED}"/usr/share/man ]] ; then
390     find "${ED}"/usr/share/man -type f -name "*.3pm" -delete
391     find "${ED}"/usr/share/man -depth -type d -empty -delete
392     fi
393     }
394    
395 monsieurp 1.150 # @FUNCTION: perl_delete_packlist
396     # @USAGE: perl_delete_packlist
397     # @DESCRIPTION:
398     # Look through ${D} for .packlist files, empty .bs files and empty directories,
399     # and get rid of items found.
400 tove 1.124 perl_delete_packlist() {
401     debug-print-function $FUNCNAME "$@"
402     perl_set_version
403 tove 1.125 if [[ -d ${D}/${VENDOR_ARCH} ]] ; then
404     find "${D}/${VENDOR_ARCH}" -type f -a \( -name .packlist \
405 tove 1.124 -o \( -name '*.bs' -a -empty \) \) -delete
406 tove 1.125 find "${D}" -depth -mindepth 1 -type d -empty -delete
407 tove 1.124 fi
408     }
409    
410 monsieurp 1.150 # @FUNCTION: perl_remove_temppath
411     # @USAGE: perl_remove_temppath
412     # @DESCRIPTION:
413     # Look through ${D} for text files containing the temporary installation
414     # folder (i.e. ${D}). If the pattern is found (i.e. " text"), replace it with `/'.
415 tove 1.124 perl_remove_temppath() {
416     debug-print-function $FUNCNAME "$@"
417    
418     find "${D}" -type f -not -name '*.so' -print0 | while read -rd '' f ; do
419     if file "${f}" | grep -q -i " text" ; then
420     grep -q "${D}" "${f}" && ewarn "QA: File contains a temporary path ${f}"
421     sed -i -e "s:${D}:/:g" "${f}"
422     fi
423     done
424     }
425    
426 monsieurp 1.145 # @FUNCTION: perl_rm_files
427     # @USAGE: perl_rm_files "file_1" "file_2"
428     # @DESCRIPTION:
429     # Remove certain files from a Perl release and remove them from the MANIFEST
430     # while we're there.
431     #
432     # Most useful in src_prepare for nuking bad tests, and is highly recommended
433     # for any tests like 'pod.t', 'pod-coverage.t' or 'kwalitee.t', as what they
434     # test is completely irrelevant to end users, and frequently fail simply
435     # because the authors of Test::Pod... changed their recommendations, and thus
436     # failures are only useful feedback to Authors, not users.
437     #
438     # Removing from MANIFEST also avoids needless log messages warning
439     # users about files "missing from their kit".
440     perl_rm_files() {
441     debug-print-function $FUNCNAME "$@"
442     local skipfile="${T}/.gentoo_makefile_skip"
443     local manifile="${S}/MANIFEST"
444     local manitemp="${T}/.gentoo_manifest_temp"
445     oldifs="$IFS"
446     IFS="\n"
447     for filename in "$@"; do
448     einfo "Removing un-needed ${filename}";
449     # Remove the file
450     rm -f "${S}/${filename}"
451     [[ -e "${manifile}" ]] && echo "${filename}" >> "${skipfile}"
452     done
453     if [[ -e "${manifile}" && -e "${skipfile}" ]]; then
454     einfo "Fixing Manifest"
455     grep -v -F -f "${skipfile}" "${manifile}" > "${manitemp}"
456     mv -f -- "${manitemp}" "${manifile}"
457     rm -- "${skipfile}";
458     fi
459     IFS="$oldifs"
460     }
461    
462 monsieurp 1.150 # @FUNCTION: perl_link_duallife_scripts
463     # @USAGE: perl_link_duallife_scripts
464     # @DESCRIPTION:
465 dilfridge 1.156 # Moves files and generates symlinks so dual-life packages installing scripts do not
466     # lead to file collisions. Mainly for use in pkg_postinst and pkg_postrm, and makes
467     # only sense for perl-core packages.
468 tove 1.124 perl_link_duallife_scripts() {
469     debug-print-function $FUNCNAME "$@"
470     if [[ ${CATEGORY} != perl-core ]] || ! has_version ">=dev-lang/perl-5.8.8-r8" ; then
471     return 0
472     fi
473    
474     local i ff
475     if has "${EBUILD_PHASE:-none}" "postinst" "postrm" ; then
476     for i in "${DUALLIFESCRIPTS[@]}" ; do
477 tove 1.130 alternatives_auto_makesym "/${i}" "/${i}-[0-9]*"
478     done
479     for i in "${DUALLIFEMAN[@]}" ; do
480     ff=`echo "${EROOT}"/${i%.1}-${PV}-${P}.1*`
481 tove 1.124 ff=${ff##*.1}
482 tove 1.130 alternatives_auto_makesym "/${i}${ff}" "/${i%.1}-[0-9]*"
483 tove 1.124 done
484     else
485     pushd "${ED}" > /dev/null
486     for i in $(find usr/bin -maxdepth 1 -type f 2>/dev/null) ; do
487     mv ${i}{,-${PV}-${P}} || die
488 tove 1.130 #DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i##*/}
489     DUALLIFESCRIPTS[${#DUALLIFESCRIPTS[*]}]=${i}
490     done
491     for i in $(find usr/share/man/man1 -maxdepth 1 -type f 2>/dev/null) ; do
492     mv ${i} ${i%.1}-${PV}-${P}.1 || die
493     DUALLIFEMAN[${#DUALLIFEMAN[*]}]=${i}
494 tove 1.124 done
495     popd > /dev/null
496     fi
497     }
498 dilfridge 1.164
499     # @FUNCTION: perl_check_env
500     # @USAGE: perl_check_env
501     # @DESCRIPTION:
502     # Checks a blacklist of known-suspect ENV values that can be accidentally set by users
503     # doing personal perl work, which may accidentally leak into portage and break the
504     # system perl installaton.
505     # Dies if any of the suspect fields are found, and tell the user what needs to be unset.
506     # There's a workaround, but you'll have to read the code for it.
507     perl_check_env() {
508     local errored value;
509    
510     for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do
511     # Next unless match
512     [ -v $i ] || continue;
513    
514     # Warn only once, and warn only when one of the bad values are set.
515     # record failure here.
516     if [ ${errored:-0} == 0 ]; then
517     if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
518     elog "perl-module.eclass: Suspicious environment values found.";
519     else
520     eerror "perl-module.eclass: Suspicious environment values found.";
521     fi
522     fi
523     errored=1
524    
525     # Read ENV Value
526     eval "value=\$$i";
527    
528     # Print ENV name/value pair
529     if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
530     elog " $i=\"$value\"";
531     else
532     eerror " $i=\"$value\"";
533     fi
534     done
535    
536     # Return if there were no failures
537     [ ${errored:-0} == 0 ] && return;
538    
539     # Return if user knows what they're doing
540     if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
541     elog "Continuing anyway, seems you know what you're doing."
542     return
543     fi
544    
545     eerror "Your environment settings may lead to undefined behavior and/or build failures."
546     die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details."
547     }

  ViewVC Help
Powered by ViewVC 1.1.20