summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-10-02 12:52:57 -0700
committerZac Medico <zmedico@gentoo.org>2011-10-02 12:52:57 -0700
commit37e01fd5095a40b6a57b1365add1c64f29671211 (patch)
treeec3c2868ef36967aebd38e44b3a6870846406438
parenta1ed3230d6a121fb2bccc0a1d51255cae382ed4f (diff)
downloadportage-37e01fd5095a40b6a57b1365add1c64f29671211.tar.gz
portage-37e01fd5095a40b6a57b1365add1c64f29671211.tar.bz2
portage-37e01fd5095a40b6a57b1365add1c64f29671211.zip
dblink._elog_process: handle newlines in messages
This will fix bug #385341.
-rw-r--r--pym/portage/dbapi/vartree.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index a4c54bd87..50fa6f5ac 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3125,9 +3125,12 @@ class dblink(object):
if isinstance(lines, basestring):
lines = [lines]
for line in lines:
- fields = (funcname, phase, cpv, line.rstrip('\n'))
- str_buffer.append(' '.join(fields))
- str_buffer.append('\n')
+ for line in line.split('\n'):
+ if not line:
+ continue
+ fields = (funcname, phase, cpv, line)
+ str_buffer.append(' '.join(fields))
+ str_buffer.append('\n')
if str_buffer:
os.write(self._pipe, _unicode_encode(''.join(str_buffer)))