public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r14682 - main/branches/2.1.7/bin
@ 2009-10-19  3:36 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-10-19  3:36 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-10-19 03:36:30 +0000 (Mon, 19 Oct 2009)
New Revision: 14682

Modified:
   main/branches/2.1.7/bin/ebuild.sh
   main/branches/2.1.7/bin/isolated-functions.sh
Log:
Preserve variables which have been set in global scope using 'declare'.
(trunk r14662)

Modified: main/branches/2.1.7/bin/ebuild.sh
===================================================================
--- main/branches/2.1.7/bin/ebuild.sh	2009-10-19 00:16:47 UTC (rev 14681)
+++ main/branches/2.1.7/bin/ebuild.sh	2009-10-19 03:36:30 UTC (rev 14682)
@@ -1633,8 +1633,8 @@
 # variables out and discards them. See bug #190128.
 filter_readonly_variables() {
 	local x filtered_vars
-	local readonly_bash_vars="DIRSTACK EUID FUNCNAME GROUPS
-		PIPESTATUS PPID SHELLOPTS UID"
+	local readonly_bash_vars="BASHPID DIRSTACK EUID FUNCNAME
+		GROUPS PIPESTATUS PPID SHELLOPTS UID"
 	local filtered_sandbox_vars="SANDBOX_ACTIVE SANDBOX_BASHRC
 		SANDBOX_DEBUG_LOG SANDBOX_DISABLED SANDBOX_LIB
 		SANDBOX_LOG SANDBOX_ON"
@@ -1817,78 +1817,75 @@
 	[[ -n $EAPI ]] || EAPI=0
 fi
 
-_source_ebuild() {
-	# The bashrcs get an opportunity here to set aliases that will be expanded
-	# during sourcing of ebuilds and eclasses.
-	source_all_bashrcs
+if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
+	if [[ $EBUILD_PHASE = depend || ! -f $T/environment || \
+		-f $PORTAGE_BUILDDIR/.ebuild_changed ]] || \
+		hasq noauto $FEATURES ; then
+		# The bashrcs get an opportunity here to set aliases that will be expanded
+		# during sourcing of ebuilds and eclasses.
+		source_all_bashrcs
 
-	# *DEPEND and IUSE will be set during the sourcing of the ebuild.
-	# In order to ensure correct interaction between ebuilds and
-	# eclasses, they need to be unset before this process of
-	# interaction begins.
-	unset DEPEND RDEPEND PDEPEND IUSE
-	source "${EBUILD}" || die "error sourcing ebuild"
+		# *DEPEND and IUSE will be set during the sourcing of the ebuild.
+		# In order to ensure correct interaction between ebuilds and
+		# eclasses, they need to be unset before this process of
+		# interaction begins.
+		unset DEPEND RDEPEND PDEPEND IUSE
+		source "${EBUILD}" || die "error sourcing ebuild"
 
-	if [ "${EBUILD_PHASE}" != "depend" ] ; then
-		RESTRICT=${PORTAGE_RESTRICT}
-		[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \
+		if [[ "${EBUILD_PHASE}" != "depend" ]] ; then
+			RESTRICT=${PORTAGE_RESTRICT}
+			[[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \
 			rm "$PORTAGE_BUILDDIR/.ebuild_changed"
-	fi
+		fi
 
-	[[ -n $EAPI ]] || EAPI=0
+		[[ -n $EAPI ]] || EAPI=0
 
-	if has "$EAPI" 0 1 2 ; then
-		export RDEPEND=${RDEPEND-${DEPEND}}
-		debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
-	fi
+		if has "$EAPI" 0 1 2 ; then
+			export RDEPEND=${RDEPEND-${DEPEND}}
+			debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
+		fi
 
-	# add in dependency info from eclasses
-	IUSE="${IUSE} ${E_IUSE}"
-	DEPEND="${DEPEND} ${E_DEPEND}"
-	RDEPEND="${RDEPEND} ${E_RDEPEND}"
-	PDEPEND="${PDEPEND} ${E_PDEPEND}"
+		# add in dependency info from eclasses
+		IUSE="${IUSE} ${E_IUSE}"
+		DEPEND="${DEPEND} ${E_DEPEND}"
+		RDEPEND="${RDEPEND} ${E_RDEPEND}"
+		PDEPEND="${PDEPEND} ${E_PDEPEND}"
 
-	unset ECLASS E_IUSE E_DEPEND E_RDEPEND E_PDEPEND
+		unset ECLASS E_IUSE E_DEPEND E_RDEPEND E_PDEPEND
 
-	# alphabetically ordered by $EBUILD_PHASE value
-	local f valid_phases
-	case "$EAPI" in
-		0|1)
-			valid_phases="src_compile pkg_config pkg_info src_install
-				pkg_nofetch pkg_postinst pkg_postrm pkg_preinst pkg_prerm
-				pkg_setup src_test src_unpack"
-			;;
-		2)
-			valid_phases="src_compile pkg_config src_configure pkg_info
-				src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
-				src_prepare pkg_prerm pkg_setup src_test src_unpack"
-			;;
-		*)
-			valid_phases="src_compile pkg_config src_configure pkg_info
-				src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
-				src_prepare pkg_prerm pkg_pretend pkg_setup src_test src_unpack"
-			;;
-	esac
+		# alphabetically ordered by $EBUILD_PHASE value
+		case "$EAPI" in
+			0|1)
+				_valid_phases="src_compile pkg_config pkg_info src_install
+					pkg_nofetch pkg_postinst pkg_postrm pkg_preinst pkg_prerm
+					pkg_setup src_test src_unpack"
+				;;
+			2)
+				_valid_phases="src_compile pkg_config src_configure pkg_info
+					src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
+					src_prepare pkg_prerm pkg_setup src_test src_unpack"
+				;;
+			*)
+				_valid_phases="src_compile pkg_config src_configure pkg_info
+					src_install pkg_nofetch pkg_postinst pkg_postrm pkg_preinst
+					src_prepare pkg_prerm pkg_pretend pkg_setup src_test src_unpack"
+				;;
+		esac
 
-	DEFINED_PHASES=
-	for f in $valid_phases ; do
-		if declare -F $f >/dev/null ; then
-			f=${f#pkg_}
-			DEFINED_PHASES+=" ${f#src_}"
-		fi
-	done
-	[[ -n $DEFINED_PHASES ]] || DEFINED_PHASES=-
+		DEFINED_PHASES=
+		for _f in $_valid_phases ; do
+			if declare -F $_f >/dev/null ; then
+				f=${f#pkg_}
+				DEFINED_PHASES+=" ${f#src_}"
+			fi
+		done
+		[[ -n $DEFINED_PHASES ]] || DEFINED_PHASES=-
 
-	# This needs to be exported since prepstrip is a separate shell script.
-	[[ -n $QA_PRESTRIPPED ]] && export QA_PRESTRIPPED
-	eval "[[ -n \$QA_PRESTRIPPED_${ARCH/-/_} ]] && export QA_PRESTRIPPED_${ARCH/-/_}"
-}
+		unset _f _valid_phases
 
-if ! hasq "$EBUILD_PHASE" clean cleanrm ; then
-	if [[ $EBUILD_PHASE = depend || ! -f $T/environment || \
-		-f $PORTAGE_BUILDDIR/.ebuild_changed ]] || \
-		hasq noauto $FEATURES ; then
-		_source_ebuild
+		# This needs to be exported since prepstrip is a separate shell script.
+		[[ -n $QA_PRESTRIPPED ]] && export QA_PRESTRIPPED
+		eval "[[ -n \$QA_PRESTRIPPED_${ARCH/-/_} ]] && export QA_PRESTRIPPED_${ARCH/-/_}"
 	fi
 fi
 

Modified: main/branches/2.1.7/bin/isolated-functions.sh
===================================================================
--- main/branches/2.1.7/bin/isolated-functions.sh	2009-10-19 00:16:47 UTC (rev 14681)
+++ main/branches/2.1.7/bin/isolated-functions.sh	2009-10-19 03:36:30 UTC (rev 14682)
@@ -573,8 +573,8 @@
 		# user config variables
 		unset DOC_SYMLINKS_DIR INSTALL_MASK PKG_INSTALL_MASK
 
-		set
-		export
+		declare -p
+		declare -fp
 	)
 }
 




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-19  3:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19  3:36 [gentoo-commits] portage r14682 - main/branches/2.1.7/bin Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox