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 (+46 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 tells users the circumvention options
561
# for the problem, whether it be unsetting the bad fields, or setting 
562
# I_KNOW_WHAT_IM_DOING=1
563
564
perl_clean_env() {
565
	local errored value;
566
567
	for i in PERL_MM_OPT PERL5LIB PERL5OPT PERL_MB_OPT PERL_CORE PERLPREFIX; do
568
		# Next unless match
569
		[ -v $i ] || continue;
570
571
		# Warn only once, and warn only when one of the bad values are set.
572
		# record failure here.
573
		[ ${errored:-0} == 0 ] && \
574
			ewarn "perl-module.eclass: Suspect ENV values found.";
575
576
		errored=1
577
578
		# Read ENV Value
579
		eval "value=\$$i";
580
581
		# Print ENV name/value pair
582
		ewarn "    $i=\"$value\"";
583
	done
584
585
	# Return if there were no failures
586
	[ ${errored:-0} == 0 ] && return;
587
588
	# Return if user knows what they're doing
589
	if [ ${I_KNOW_WHAT_IM_DOING:-0} == 1 ]; then
590
		ewarn "Continuing due to I_KNOW_WHAT_IM_DOING=1"
591
		return
592
	fi
593
594
	die "Please unset from ENV ( ~/.bashrc, package.env, etc ) or set I_KNOW_WHAT_IM_DOING=1"
595
}
596

Return to bug 543042