In source_all_bashrcs(), only change $IFS while splitting $PROFILE_PATHS into
authorZac Medico <zmedico@gentoo.org>
Mon, 11 Aug 2008 06:52:45 +0000 (06:52 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 11 Aug 2008 06:52:45 +0000 (06:52 -0000)
an array, and then restore it before doing anything else. This avoids
interference that can otherwise occur if code from profile.bashrc (or
/etc/portage/env, be extension) needs to call any of the elog functions
which use the save_IFS and restore_IFS aliases internally.

svn path=/main/trunk/; revision=11397

bin/ebuild.sh

index 68536ee827fb3bcc506553b945bd14215a7f1b95..7110c42570d0a0e1f1244e00b1a9338ea7e5eda4 100755 (executable)
@@ -1513,13 +1513,12 @@ source_all_bashrcs() {
        # source the existing profile.bashrc's.
        save_IFS
        IFS=$'\n'
-       for x in ${PROFILE_PATHS}; do
-               # Must unset it so that it doesn't mess up assumptions in the RCs.
-               unset IFS
+       local path_array=($PROFILE_PATHS)
+       restore_IFS
+       for x in ${path_array[@]} ; do
                [ -f "${x}/profile.bashrc" ] && qa_source "${x}/profile.bashrc"
        done
-       restore_IFS
-       
+
        # We assume if people are changing shopts in their bashrc they do so at their
        # own peril.  This is the ONLY non-portage bit of code that can change shopts
        # without a QA violation.