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

Collapse All | Expand All

(-)prefix-portage-2.2.01.21165.orig/bin/ebuild.sh (-1 / +53 lines)
Lines 86-92 __qa_source() { Link Here
86
__qa_call() {
86
__qa_call() {
87
	local shopts=$(shopt) OLDIFS="$IFS"
87
	local shopts=$(shopt) OLDIFS="$IFS"
88
	local retval
88
	local retval
89
	"$@"
89
	call-ebuildshell "$@"
90
	retval=$?
90
	retval=$?
91
	set +e
91
	set +e
92
	[[ $shopts != $(shopt) ]] &&
92
	[[ $shopts != $(shopt) ]] &&
Lines 473-478 if [[ -n ${QA_INTERCEPTORS} ]] ; then Link Here
473
	unset BIN_PATH BIN BODY FUNC_SRC
473
	unset BIN_PATH BIN BODY FUNC_SRC
474
fi
474
fi
475
475
476
call-ebuildshell() {
477
	if ! has ebuildshell ${FEATURES}; then
478
		"$@"
479
		return $?
480
	fi
481
	(
482
		umask 002
483
		(
484
			(
485
				set
486
				declare -p
487
				declare -fp
488
				shopt -p
489
				if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
490
					export
491
				fi
492
			) | __filter_readonly_variables --filter-for-subshell
493
			echo 'declare -r $PORTAGE_READONLY_METADATA $PORTAGE_READONLY_VARS'
494
			echo "export PS1='EBUILD ${PN} $1 \$ '" 
495
			echo 'unset ENV'
496
			echo "type $1"
497
			echo "echo WANTED: $@"
498
			echo "trap '"
499
			echo "umask 002"
500
			echo "("
501
			echo "	set"
502
			echo "	declare -p"
503
			echo "	declare -fp"
504
			echo "	shopt -p | grep -v extdebug$"
505
			if [[ ${BASH_VERSINFO[0]} == 3 ]]; then
506
				echo "	export"
507
			fi
508
			echo -n ")"
509
			echo -n " | __filter_readonly_variables --filter-metadata"
510
			echo " > ${T}/ebuildshell-environment-outcome' 0"
511
			echo "shopt -u extdebug"
512
			echo "trap - DEBUG"
513
		) > ${T}/ebuildshell-environment
514
		chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment" &>/dev/null
515
		chmod g+w "${T}/ebuildshell-environment" &>/dev/null
516
	)
517
518
	rm -f "${T}/ebuildshell-environment-outcome" >&/dev/null
519
520
	unset BASH_ENV
521
	env -i ${BASH} --rcfile "${T}/ebuildshell-environment"  -i || die
522
523
	chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/ebuildshell-environment-outcome" &>/dev/null
524
	chmod g+w "${T}/ebuildshell-environment-outcome" &>/dev/null
525
	source "${T}/ebuildshell-environment-outcome" &>/dev/null
526
}
527
476
# Subshell/helper die support (must export for the die helper).
528
# Subshell/helper die support (must export for the die helper).
477
export EBUILD_MASTER_PID=$BASHPID
529
export EBUILD_MASTER_PID=$BASHPID
478
trap 'exit 1' SIGTERM
530
trap 'exit 1' SIGTERM
(-)prefix-portage-2.2.01.21165.orig/bin/phase-functions.sh (-4 / +10 lines)
Lines 84-90 PORTAGE_MUTABLE_FILTERED_VARS="AA HOSTNA Link Here
84
__filter_readonly_variables() {
84
__filter_readonly_variables() {
85
	local x filtered_vars
85
	local x filtered_vars
86
	local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
86
	local readonly_bash_vars="BASHOPTS BASHPID DIRSTACK EUID
87
		FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID"
87
		FUNCNAME GROUPS PIPESTATUS PPID SHELLOPTS UID BASH_VERSINFO"
88
	local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
88
	local bash_misc_vars="BASH BASH_.* COLUMNS COMP_WORDBREAKS HISTCMD
89
		HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
89
		HISTFILE HOSTNAME HOSTTYPE IFS LINENO MACHTYPE OLDPWD
90
		OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
90
		OPTERR OPTIND OSTYPE POSIXLY_CORRECT PS4 PWD RANDOM
Lines 95-102 __filter_readonly_variables() { Link Here
95
	# Untrusted due to possible application of package renames to binpkgs
95
	# Untrusted due to possible application of package renames to binpkgs
96
	local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
96
	local binpkg_untrusted_vars="CATEGORY P PF PN PR PV PVR"
97
	local misc_garbage_vars="_portage_filter_opts"
97
	local misc_garbage_vars="_portage_filter_opts"
98
	filtered_vars="$readonly_bash_vars $bash_misc_vars
98
	filtered_vars="$readonly_bash_vars"
99
		$PORTAGE_READONLY_VARS $misc_garbage_vars"
99
	if ! has --filter-for-subshell $* ; then
100
		filtered_vars="$filtered_vars $bash_misc_vars $PORTAGE_READONLY_VARS $misc_garbage_vars"
101
	fi
100
102
101
	# Don't filter/interfere with prefix variables unless they are
103
	# Don't filter/interfere with prefix variables unless they are
102
	# supported by the current EAPI.
104
	# supported by the current EAPI.
Lines 120-126 __filter_readonly_variables() { Link Here
120
			LC_CTYPE LC_MESSAGES LC_MONETARY
122
			LC_CTYPE LC_MESSAGES LC_MONETARY
121
			LC_NUMERIC LC_PAPER LC_TIME"
123
			LC_NUMERIC LC_PAPER LC_TIME"
122
	fi
124
	fi
123
	if ! has --allow-extra-vars $* ; then
125
	if has --filter-metadata $* ; then
126
		filtered_vars="$filtered_vars $PORTAGE_READONLY_METADATA"
127
	fi
128
	if ! has --allow-extra-vars $* &&
129
	   ! has --filter-for-subshell $* ; then
124
		if [ "${EMERGE_FROM}" = binary ] ; then
130
		if [ "${EMERGE_FROM}" = binary ] ; then
125
			# preserve additional variables from build time,
131
			# preserve additional variables from build time,
126
			# while excluding untrusted variables
132
			# while excluding untrusted variables
(-)prefix-portage-2.2.01.21165.orig/man/make.conf.5 (+6 lines)
Lines 313-318 exist). Also see the related \fIunmerge\ Link Here
313
Use locks to ensure that unsandboxed ebuild phases never execute
313
Use locks to ensure that unsandboxed ebuild phases never execute
314
concurrently. Also see \fIparallel\-install\fR.
314
concurrently. Also see \fIparallel\-install\fR.
315
.TP
315
.TP
316
.B ebuildshell
317
Drop into an interactive shell for each phase function, meant for
318
debugging.  Because the shell would normally be used to execute the
319
phase function, commands like src_unpack or epatch are available in the
320
interactive shell.  Use `exit 1` to terminate the merge.
321
.TP
316
.B fakeroot
322
.B fakeroot
317
Enable fakeroot for the install and package phases when a non-root user runs
323
Enable fakeroot for the install and package phases when a non-root user runs
318
the \fBebuild\fR(1) command.
324
the \fBebuild\fR(1) command.
(-)prefix-portage-2.2.01.21165.orig/pym/_emerge/AbstractEbuildProcess.py (+1 lines)
Lines 97-102 class AbstractEbuildProcess(SpawnProcess Link Here
97
			self.fd_pipes = {}
97
			self.fd_pipes = {}
98
		null_fd = None
98
		null_fd = None
99
		if 0 not in self.fd_pipes and \
99
		if 0 not in self.fd_pipes and \
100
			"ebuildshell" not in self.settings.features and \
100
			self.phase not in self._phases_interactive_whitelist and \
101
			self.phase not in self._phases_interactive_whitelist and \
101
			"interactive" not in self.settings.get("PROPERTIES", "").split():
102
			"interactive" not in self.settings.get("PROPERTIES", "").split():
102
			null_fd = os.open('/dev/null', os.O_RDONLY)
103
			null_fd = os.open('/dev/null', os.O_RDONLY)
(-)prefix-portage-2.2.01.21165.orig/pym/portage/const.py (-1 / +1 lines)
Lines 131-137 SUPPORTED_FEATURES = frozenset([ Link Here
131
                           "collision-protect", "compress-build-logs", "compressdebug",
131
                           "collision-protect", "compress-build-logs", "compressdebug",
132
                           "compress-index", "config-protect-if-modified",
132
                           "compress-index", "config-protect-if-modified",
133
                           "digest", "distcc", "distcc-pump", "distlocks",
133
                           "digest", "distcc", "distcc-pump", "distlocks",
134
                           "downgrade-backup", "ebuild-locks", "fakeroot",
134
                           "downgrade-backup", "ebuildshell", "ebuild-locks", "fakeroot",
135
                           "fail-clean", "force-mirror", "force-prefix", "getbinpkg",
135
                           "fail-clean", "force-mirror", "force-prefix", "getbinpkg",
136
                           "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
136
                           "installsources", "keeptemp", "keepwork", "fixlafiles", "lmirror",
137
                           "metadata-transfer", "mirror", "multilib-strict", "news",
137
                           "metadata-transfer", "mirror", "multilib-strict", "news",

Return to bug 155161