From: Fabian Groffen Date: Mon, 28 Jul 2008 20:03:55 +0000 (-0000) Subject: Merged from trunk 11243:11245 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=a58ce4b596542c6d73012ed14fd7746fa9ffce78;p=portage.git Merged from trunk 11243:11245 | 11244 | Even though the message is split on $'\n' in elog_base(), | | zmedico | it's still not entirely safe to use it as a delimiter in the | | | log file since there can still be escaped newlines that will | | | be expanded due to the echo -e parameter. | | 11245 | Bug #233103 - In portage.fetch(), pass all config variables | | zmedico | instead of just those returned by the environ() method which | | | is filtered. | svn path=/main/branches/prefix/; revision=11246 --- diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 5b3027b43..8e43de36b 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -177,10 +177,14 @@ elog_base() { return 1 ;; esac + # Note: Even though the message is split on $'\n' here, it's still + # not entirely safe to use it as a delimiter in the log file since + # there can still be escaped newlines that will be expanded due to + # the echo -e parameter. save_IFS IFS=$'\n' for line in $* ; do - echo -ne "${messagetype} ${line}\n" >> \ + echo -ne "${messagetype} ${line}\n\0" >> \ "${T}/logging/${EBUILD_PHASE:-other}" done restore_IFS diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 38b610092..e6a3d1695 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -3868,7 +3868,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks", myfetch = ["bash", "-c", "exec \"$@\"", myfetch[0]] + myfetch myret = portage.process.spawn(myfetch, - env=mysettings.environ(), **spawn_keywords) + env=dict(mysettings.iteritems()), **spawn_keywords) if mysettings.selinux_enabled(): selinux.setexec(None) diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py index d9e26ce87..5455e17f4 100644 --- a/pym/portage/elog/messages.py +++ b/pym/portage/elog/messages.py @@ -35,7 +35,7 @@ def collect_ebuild_messages(path): logentries[msgfunction] = [] lastmsgtype = None msgcontent = [] - for l in open(filename, "r"): + for l in open(filename, "r").read().split("\0"): if not l: continue try: