Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11244 - in main/trunk: bin pym/portage/elog
Date: Mon, 28 Jul 2008 19:48:03
Message-Id: E1KNYhN-0005mG-56@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-07-28 19:48:00 +0000 (Mon, 28 Jul 2008)
3 New Revision: 11244
4
5 Modified:
6 main/trunk/bin/isolated-functions.sh
7 main/trunk/pym/portage/elog/messages.py
8 Log:
9 Even though the message is split on $'\n' in elog_base(), it's still
10 not entirely safe to use it as a delimiter in the log file since
11 there can still be escaped newlines that will be expanded due to
12 the echo -e parameter.
13
14
15 Modified: main/trunk/bin/isolated-functions.sh
16 ===================================================================
17 --- main/trunk/bin/isolated-functions.sh 2008-07-28 18:38:40 UTC (rev 11243)
18 +++ main/trunk/bin/isolated-functions.sh 2008-07-28 19:48:00 UTC (rev 11244)
19 @@ -170,10 +170,14 @@
20 return 1
21 ;;
22 esac
23 + # Note: Even though the message is split on $'\n' here, it's still
24 + # not entirely safe to use it as a delimiter in the log file since
25 + # there can still be escaped newlines that will be expanded due to
26 + # the echo -e parameter.
27 save_IFS
28 IFS=$'\n'
29 for line in $* ; do
30 - echo -ne "${messagetype} ${line}\n" >> \
31 + echo -ne "${messagetype} ${line}\n\0" >> \
32 "${T}/logging/${EBUILD_PHASE:-other}"
33 done
34 restore_IFS
35
36 Modified: main/trunk/pym/portage/elog/messages.py
37 ===================================================================
38 --- main/trunk/pym/portage/elog/messages.py 2008-07-28 18:38:40 UTC (rev 11243)
39 +++ main/trunk/pym/portage/elog/messages.py 2008-07-28 19:48:00 UTC (rev 11244)
40 @@ -35,7 +35,7 @@
41 logentries[msgfunction] = []
42 lastmsgtype = None
43 msgcontent = []
44 - for l in open(filename, "r"):
45 + for l in open(filename, "r").read().split("\0"):
46 if not l:
47 continue
48 try: