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 (+52 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 548-550 Link Here
548
		popd > /dev/null
550
		popd > /dev/null
549
	fi
551
	fi
550
}
552
}
553
554
# @FUNCTION: perl_check_env
555
# @USAGE: perl_check_env
556
# @DESCRIPTION:
557
# Checks a blacklist of known-suspect ENV values that can be accidentally set by users
558
# doing personal perl work, which may accidentally leak into portage and break the
559
# system perl installaton.
560
# Dies if any of the suspect fields are found, and tell the user what needs to be unset.
561
# There's a workaround, but you'll have to read the code for it.
562
perl_check_env() {
563
	local errored value;
564
565
	for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do
566
		# Next unless match
567
		[ -v $i ] || continue;
568
569
		# Warn only once, and warn only when one of the bad values are set.
570
		# record failure here.
571
		if [ ${errored:-0} == 0 ]; then
572
			if [ -n ${I_KNOW_WHAT_I_AM_DOING} ]; then
573
				elog "perl-module.eclass: Suspicious environment values found.";
574
			else
575
				eerror "perl-module.eclass: Suspicious environment values found.";
576
			fi
577
		fi
578
		errored=1
579
580
		# Read ENV Value
581
		eval "value=\$$i";
582
583
		# Print ENV name/value pair
584
		if [ -n ${I_KNOW_WHAT_I_AM_DOING} ]; then
585
			elog "    $i=\"$value\"";
586
		else
587
			eerror "    $i=\"$value\"";
588
		fi
589
	done
590
591
	# Return if there were no failures
592
	[ ${errored:-0} == 0 ] && return;
593
594
	# Return if user knows what they're doing
595
	if [ -n ${I_KNOW_WHAT_I_AM_DOING} ]; then
596
		elog "Continuing anyway, seems you know what you're doing."
597
		return
598
	fi
599
600
	eerror "Your environment settings may lead to undefined behavior and/or build failures."
601
	die "Please fix them ( ~/.bashrc, package.env, ... )."
602
}

Return to bug 543042