From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R2upu-0002N5-Pr for garchives@archives.gentoo.org; Mon, 12 Sep 2011 00:57:23 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F239D21C025; Mon, 12 Sep 2011 00:57:14 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9274421C025 for ; Mon, 12 Sep 2011 00:57:14 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EFE9E1B4009 for ; Mon, 12 Sep 2011 00:57:13 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 0F4C880042 for ; Mon, 12 Sep 2011 00:57:13 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <80737f32ff8bcebe327821243594d17bd4f79fdd.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/ebuild.sh bin/isolated-functions.sh bin/phase-functions.sh bin/save-ebuild-env.sh X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 80737f32ff8bcebe327821243594d17bd4f79fdd Date: Mon, 12 Sep 2011 00:57:13 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: ef0a731c98f2676f1a71408b447feb41 commit: 80737f32ff8bcebe327821243594d17bd4f79fdd Author: Zac Medico gentoo org> AuthorDate: Mon Sep 12 00:56:57 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Sep 12 00:56:57 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D80737f32 isolated-functions.sh: split save-ebuild-env.sh --- bin/ebuild.sh | 1 + bin/isolated-functions.sh | 91 ---------------------------------------= ----- bin/phase-functions.sh | 2 +- bin/save-ebuild-env.sh | 93 +++++++++++++++++++++++++++++++++++++++= ++++++ 4 files changed, 95 insertions(+), 92 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 1cb9269..1d01416 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -20,6 +20,7 @@ source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || e= xit 1 =20 if [[ $EBUILD_PHASE !=3D depend ]] ; then source "${PORTAGE_BIN_PATH}/phase-functions.sh" || die + source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || die source "${PORTAGE_BIN_PATH}/phase-helpers.sh" || die source "${PORTAGE_BIN_PATH}/bashrc-functions.sh" || die else diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index c5adc0c..5247e7e 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -541,95 +541,4 @@ has() { return 1 } =20 -# @FUNCTION: save_ebuild_env -# @DESCRIPTION: -# echo the current environment to stdout, filtering out redundant info. -# -# --exclude-init-phases causes pkg_nofetch and src_* phase functions to -# be excluded from the output. These function are not needed for install= ation -# or removal of the packages, and can therefore be safely excluded. -# -save_ebuild_env() { - ( - - if has --exclude-init-phases $* ; then - unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ - if [[ -n $PYTHONPATH ]] ; then - export PYTHONPATH=3D${PYTHONPATH/${PORTAGE_PYM_PATH}:} - [[ -z $PYTHONPATH ]] && unset PYTHONPATH - fi - fi - - # misc variables inherited from the calling environment - unset COLORTERM DISPLAY EDITOR LESS LESSOPEN LOGNAME LS_COLORS PAGER \ - TERM TERMCAP USER ftp_proxy http_proxy no_proxy - - # other variables inherited from the calling environment - unset CVS_RSH ECHANGELOG_USER GPG_AGENT_INFO \ - SSH_AGENT_PID SSH_AUTH_SOCK STY WINDOW XAUTHORITY - - # CCACHE and DISTCC config - unset ${!CCACHE_*} ${!DISTCC_*} - - # There's no need to bloat environment.bz2 with internally defined - # functions and variables, so filter them out if possible. - - for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \ - src_compile src_test src_install pkg_preinst pkg_postinst \ - pkg_prerm pkg_postrm ; do - unset -f default_$x _eapi{0,1,2,3,4}_$x - done - unset x - - unset -f assert assert_sigpipe_ok dump_trace die diefunc \ - quiet_mode vecho elog_base eqawarn elog \ - esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \ - KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \ - has_phase_defined_up_to \ - hasv hasq qa_source qa_call \ - addread addwrite adddeny addpredict _sb_append_var \ - use usev useq has_version portageq \ - best_version use_with use_enable register_die_hook \ - keepdir unpack strip_duplicate_slashes econf einstall \ - dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \ - insopts diropts exeopts libopts docompress \ - abort_handler abort_prepare abort_configure abort_compile \ - abort_test abort_install dyn_prepare dyn_configure \ - dyn_compile dyn_test dyn_install \ - dyn_preinst dyn_help debug-print debug-print-function \ - debug-print-section inherit EXPORT_FUNCTIONS remove_path_entry \ - save_ebuild_env filter_readonly_variables preprocess_ebuild_env \ - set_unless_changed unset_unless_changed source_all_bashrcs \ - ebuild_main ebuild_phase ebuild_phase_with_hooks \ - _ebuild_arg_to_phase _ebuild_phase_funcs default \ - _hasg _hasgq _unpack_tar \ - ${QA_INTERCEPTORS} - - # portage config variables and variables set directly by portage - unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \ - DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \ - EBUILD_FORCE_TEST EBUILD_MASTER_PID \ - ECLASS_DEPTH ENDCOL FAKEROOTKEY \ - GOOD HILITE HOME \ - LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \ - NOCOLOR NORMAL PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \ - PORTAGE_BASHRCS_SOURCED PORTAGE_NONFATAL PORTAGE_QUIET \ - PORTAGE_SANDBOX_DENY PORTAGE_SANDBOX_PREDICT \ - PORTAGE_SANDBOX_READ PORTAGE_SANDBOX_WRITE PREROOTPATH \ - QA_INTERCEPTORS \ - RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL RC_INDENTATION \ - ROOT ROOTPATH RPMDIR TEMP TMP TMPDIR USE_EXPAND \ - WARN XARGS _RC_GET_KV_CACHE - - # user config variables - unset DOC_SYMLINKS_DIR INSTALL_MASK PKG_INSTALL_MASK - - declare -p - declare -fp - if [[ ${BASH_VERSINFO[0]} =3D=3D 3 ]]; then - export - fi - ) -} - true diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index f1db257..164b309 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -167,7 +167,7 @@ preprocess_ebuild_env() { # by the above source command. To protect ourselves, we override it # here with our own version. ${PORTAGE_BIN_PATH} is safe to use here # because it's already filtered above. - source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || exit $? + source "${PORTAGE_BIN_PATH}/save-ebuild-env.sh" || exit $? =20 # Rely on save_ebuild_env() to filter out any remaining variables # and functions that could interfere with the current environment. diff --git a/bin/save-ebuild-env.sh b/bin/save-ebuild-env.sh new file mode 100644 index 0000000..3bb8255 --- /dev/null +++ b/bin/save-ebuild-env.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# @FUNCTION: save_ebuild_env +# @DESCRIPTION: +# echo the current environment to stdout, filtering out redundant info. +# +# --exclude-init-phases causes pkg_nofetch and src_* phase functions to +# be excluded from the output. These function are not needed for install= ation +# or removal of the packages, and can therefore be safely excluded. +# +save_ebuild_env() { + ( + if has --exclude-init-phases $* ; then + unset S _E_DOCDESTTREE_ _E_EXEDESTTREE_ + if [[ -n $PYTHONPATH ]] ; then + export PYTHONPATH=3D${PYTHONPATH/${PORTAGE_PYM_PATH}:} + [[ -z $PYTHONPATH ]] && unset PYTHONPATH + fi + fi + + # misc variables inherited from the calling environment + unset COLORTERM DISPLAY EDITOR LESS LESSOPEN LOGNAME LS_COLORS PAGER \ + TERM TERMCAP USER ftp_proxy http_proxy no_proxy + + # other variables inherited from the calling environment + unset CVS_RSH ECHANGELOG_USER GPG_AGENT_INFO \ + SSH_AGENT_PID SSH_AUTH_SOCK STY WINDOW XAUTHORITY + + # CCACHE and DISTCC config + unset ${!CCACHE_*} ${!DISTCC_*} + + # There's no need to bloat environment.bz2 with internally defined + # functions and variables, so filter them out if possible. + + for x in pkg_setup pkg_nofetch src_unpack src_prepare src_configure \ + src_compile src_test src_install pkg_preinst pkg_postinst \ + pkg_prerm pkg_postrm ; do + unset -f default_$x _eapi{0,1,2,3,4}_$x + done + unset x + + unset -f assert assert_sigpipe_ok dump_trace die diefunc \ + quiet_mode vecho elog_base eqawarn elog \ + esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \ + KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \ + has_phase_defined_up_to \ + hasv hasq qa_source qa_call \ + addread addwrite adddeny addpredict _sb_append_var \ + use usev useq has_version portageq \ + best_version use_with use_enable register_die_hook \ + keepdir unpack strip_duplicate_slashes econf einstall \ + dyn_setup dyn_unpack dyn_clean into insinto exeinto docinto \ + insopts diropts exeopts libopts docompress \ + abort_handler abort_prepare abort_configure abort_compile \ + abort_test abort_install dyn_prepare dyn_configure \ + dyn_compile dyn_test dyn_install \ + dyn_preinst dyn_help debug-print debug-print-function \ + debug-print-section inherit EXPORT_FUNCTIONS remove_path_entry \ + save_ebuild_env filter_readonly_variables preprocess_ebuild_env \ + set_unless_changed unset_unless_changed source_all_bashrcs \ + ebuild_main ebuild_phase ebuild_phase_with_hooks \ + _ebuild_arg_to_phase _ebuild_phase_funcs default \ + _hasg _hasgq _unpack_tar \ + ${QA_INTERCEPTORS} + + # portage config variables and variables set directly by portage + unset ACCEPT_LICENSE BAD BRACKET BUILD_PREFIX COLS \ + DISTCC_DIR DISTDIR DOC_SYMLINKS_DIR \ + EBUILD_FORCE_TEST EBUILD_MASTER_PID \ + ECLASS_DEPTH ENDCOL FAKEROOTKEY \ + GOOD HILITE HOME \ + LAST_E_CMD LAST_E_LEN LD_PRELOAD MISC_FUNCTIONS_ARGS MOPREFIX \ + NOCOLOR NORMAL PKGDIR PKGUSE PKG_LOGDIR PKG_TMPDIR \ + PORTAGE_BASHRCS_SOURCED PORTAGE_NONFATAL PORTAGE_QUIET \ + PORTAGE_SANDBOX_DENY PORTAGE_SANDBOX_PREDICT \ + PORTAGE_SANDBOX_READ PORTAGE_SANDBOX_WRITE PREROOTPATH \ + QA_INTERCEPTORS \ + RC_DEFAULT_INDENT RC_DOT_PATTERN RC_ENDCOL RC_INDENTATION \ + ROOT ROOTPATH RPMDIR TEMP TMP TMPDIR USE_EXPAND \ + WARN XARGS _RC_GET_KV_CACHE + + # user config variables + unset DOC_SYMLINKS_DIR INSTALL_MASK PKG_INSTALL_MASK + + declare -p + declare -fp + if [[ ${BASH_VERSINFO[0]} =3D=3D 3 ]]; then + export + fi + ) +}