summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2008-04-06 14:20:52 +0000
committerMarius Mauch <genone@gentoo.org>2008-04-06 14:20:52 +0000
commit605d41153a999b6824f73083a323c4ba283307a9 (patch)
tree260b2524ad5e7f6450cb1a58f0e16fca31249e84
parent2e647d30eaec193dafbf61d5e424bb04c2f83bf1 (diff)
downloadportage-605d41153a999b6824f73083a323c4ba283307a9.tar.gz
portage-605d41153a999b6824f73083a323c4ba283307a9.tar.bz2
portage-605d41153a999b6824f73083a323c4ba283307a9.zip
preserve order of ebuild messages even between different message types (bug #197905)
svn path=/main/trunk/; revision=9726
-rwxr-xr-xbin/isolated-functions.sh2
-rw-r--r--pym/portage/elog/messages.py19
2 files changed, 16 insertions, 5 deletions
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 08d1fcb0e..96594d8fe 100755
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -164,7 +164,7 @@ elog_base() {
return 1
;;
esac
- echo -e "$*" >> "${T}/logging/${EBUILD_PHASE:-other}.${messagetype}"
+ echo -e "${messagetype} $*" >> "${T}/logging/${EBUILD_PHASE:-other}"
return 0
}
diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py
index 852b71af9..ed5c8c9dd 100644
--- a/pym/portage/elog/messages.py
+++ b/pym/portage/elog/messages.py
@@ -24,16 +24,27 @@ def collect_ebuild_messages(path):
# exploit listdir() file order so we process log entries in chronological order
mylogfiles.reverse()
logentries = {}
- for f in mylogfiles:
- msgfunction, msgtype = f.split(".")
+ for msgfunction in mylogfiles:
if msgfunction not in EBUILD_PHASES:
writemsg("!!! can't process invalid log file: %s\n" % f,
noiselevel=-1)
continue
if not msgfunction in logentries:
logentries[msgfunction] = []
- msgcontent = open(os.path.join(path, f), "r").readlines()
- logentries[msgfunction].append((msgtype, msgcontent))
+ lastmsgtype = None
+ msgcontent = []
+ for l in open(os.path.join(path, msgfunction), "r").readlines():
+ msgtype, msg = l.split(" ", 1)
+ if lastmsgtype is None:
+ lastmsgtype = msgtype
+ if msgtype == lastmsgtype:
+ msgcontent.append(msg)
+ else:
+ if msgcontent:
+ logentries[msgfunction].append((lastmsgtype, msgcontent))
+ msgcontent = [msg]
+ lastmsgtype = msgtype
+
# clean logfiles to avoid repetitions
for f in mylogfiles:
try: