Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 543042 | Differences between
and this patch

Collapse All | Expand All

(-)perl-module.eclass (-20 / +83 lines)
Lines 114-119 Link Here
114
	[[ ${SRC_PREP} = yes ]] && return 0
114
	[[ ${SRC_PREP} = yes ]] && return 0
115
	SRC_PREP="yes"
115
	SRC_PREP="yes"
116
116
117
	perl_check_env
118
117
	perl_set_version
119
	perl_set_version
118
120
119
	[[ -z ${pm_echovar} ]] && export PERL_MM_USE_DEFAULT=1
121
	[[ -z ${pm_echovar} ]] && export PERL_MM_USE_DEFAULT=1
Lines 127-139 Link Here
127
	fi
129
	fi
128
130
129
	if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
131
	if [[ ( ${PREFER_BUILDPL} == yes || ! -f Makefile.PL ) && -f Build.PL ]] ; then
130
		einfo "Using Module::Build"
132
		if grep -q '\(use\|require\)\s*Module::Build::Tiny' Build.PL ; then
131
		if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then
133
			einfo "Using Module::Build::Tiny"
132
			eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
134
			if [[ ${DEPEND} != *dev-perl/Module-Build-Tiny* && ${PN} != Module-Build-Tiny ]]; then
133
			eqawarn "           Add virtual/perl-Module-Build to DEPEND!"
135
				eqawarn "QA Notice: The ebuild uses Module::Build::Tiny but doesn't depend on it."
134
			if [[ -n ${PERLQAFATAL} ]]; then
136
				eqawarn " Add dev-perl/Module-Build-Tiny to DEPEND!"
135
				eerror "Bailing out due to PERLQAFATAL=1";
137
				if [[ -n ${PERLQAFATAL} ]]; then
136
				die;
138
					eerror "Bailing out due to PERLQAFATAL=1";
139
					die
140
				fi
141
			fi
142
		else
143
			einfo "Using Module::Build"
144
			if [[ ${DEPEND} != *virtual/perl-Module-Build* && ${PN} != Module-Build ]] ; then
145
				eqawarn "QA Notice: The ebuild uses Module::Build but doesn't depend on it."
146
				eqawarn " Add virtual/perl-Module-Build to DEPEND!"
147
				if [[ -n ${PERLQAFATAL} ]]; then
148
					eerror "Bailing out due to PERLQAFATAL=1";
149
					die
150
				fi
137
			fi
151
			fi
138
		fi
152
		fi
139
		set -- \
153
		set -- \
Lines 256-278 Link Here
256
270
257
	local f
271
	local f
258
272
259
	if [[ -z ${mytargets} ]] ; then
273
	if [[ -f Build ]]; then
274
		mytargets="${mytargets:-install}"
275
		mbparams="${mbparams:---pure}"
276
		einfo "./Build ${mytargets} ${mbparams}"
277
		./Build ${mytargets} ${mbparams} \
278
			|| die "./Build ${mytargets} ${mbparams} failed"
279
	elif [[ -f Makefile ]]; then
260
		case "${CATEGORY}" in
280
		case "${CATEGORY}" in
261
			dev-perl|perl-core) mytargets="pure_install" ;;
281
			dev-perl|perl-core) mytargets="pure_install" ;;
262
			*)                  mytargets="install" ;;
282
			*)                  mytargets="install" ;;
263
		esac
283
		esac
264
	fi
284
		if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then
265
285
			local myinst_local=(${myinst})
266
	if [[ $(declare -p myinst 2>&-) != "declare -a myinst="* ]]; then
286
		else
267
		local myinst_local=(${myinst})
287
			local myinst_local=("${myinst[@]}")
268
	else
288
		fi
269
		local myinst_local=("${myinst[@]}")
270
	fi
271
272
	if [[ -f Build ]] ; then
273
		./Build ${mytargets} \
274
			|| die "./Build ${mytargets} failed"
275
	elif [[ -f Makefile ]] ; then
276
		emake "${myinst_local[@]}" ${mytargets} \
289
		emake "${myinst_local[@]}" ${mytargets} \
277
			|| die "emake ${myinst_local[@]} ${mytargets} failed"
290
			|| die "emake ${myinst_local[@]} ${mytargets} failed"
278
	fi
291
	fi
Lines 548-550 Link Here
548
		popd > /dev/null
561
		popd > /dev/null
549
	fi
562
	fi
550
}
563
}
564
565
# @FUNCTION: perl_check_env
566
# @USAGE: perl_check_env
567
# @DESCRIPTION:
568
# Checks a blacklist of known-suspect ENV values that can be accidentally set by users
569
# doing personal perl work, which may accidentally leak into portage and break the
570
# system perl installaton.
571
# Dies if any of the suspect fields are found, and tell the user what needs to be unset.
572
# There's a workaround, but you'll have to read the code for it.
573
perl_check_env() {
574
	local errored value;
575
576
	for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do
577
		# Next unless match
578
		[ -v $i ] || continue;
579
580
		# Warn only once, and warn only when one of the bad values are set.
581
		# record failure here.
582
		if [ ${errored:-0} == 0 ]; then
583
			if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
584
				elog "perl-module.eclass: Suspicious environment values found.";
585
			else
586
				eerror "perl-module.eclass: Suspicious environment values found.";
587
			fi
588
		fi
589
		errored=1
590
591
		# Read ENV Value
592
		eval "value=\$$i";
593
594
		# Print ENV name/value pair
595
		if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
596
			elog "    $i=\"$value\"";
597
		else
598
			eerror "    $i=\"$value\"";
599
		fi
600
	done
601
602
	# Return if there were no failures
603
	[ ${errored:-0} == 0 ] && return;
604
605
	# Return if user knows what they're doing
606
	if [ -n "${I_KNOW_WHAT_I_AM_DOING}" ]; then
607
		elog "Continuing anyway, seems you know what you're doing."
608
		return
609
	fi
610
611
	eerror "Your environment settings may lead to undefined behavior and/or build failures."
612
	die "Please fix your environment ( ~/.bashrc, package.env, ... ), see above for details."
613
}

Return to bug 543042