return rValue
_elog_atexit_handlers = []
-def elog_process(cpv, mysettings):
+_preserve_logentries = {}
+def elog_process(cpv, mysettings, phasefilter=None):
ebuild_logentries = collect_ebuild_messages(os.path.join(mysettings["T"], "logging"))
all_logentries = collect_messages()
if all_logentries.has_key(cpv):
else:
all_logentries[cpv] = ebuild_logentries
- my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split())
+ for key in _preserve_logentries.keys():
+ if all_logentries.has_key(key):
+ all_logentries[key] = _merge_logentries(_preserve_logentries[key], all_logentries[key])
+ else:
+ all_logentries[key] = _preserve_logentries[key]
+ del _preserve_logentries[key]
+
+ if phasefilter != None:
+ for key in all_logentries:
+ all_logentries[key], _preserve_logentries[key] = phasefilter(all_logentries[key])
+ my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split())
for key in all_logentries:
default_logentries = filter_loglevels(all_logentries[key], my_elog_classes)
# Distributed under the terms of the GNU General Public License v2
# $Id: __init__.py 6458 2007-04-30 02:31:30Z genone $
+from portage.const import EBUILD_PHASES
+
def filter_loglevels(logentries, loglevels):
# remove unwanted entries from all logentries
rValue = {}
rValue[phase].append((msgtype, msgcontent))
return rValue
+def filter_phases(logentries, phases):
+ rValue1 = {}
+ rValue2 = {}
+ phases = map(str.lower, phases)
+ for phase in logentries:
+ if phase in phases:
+ rValue1[phase] = logentries[phase]
+ else:
+ rValue2[phase] = logentries[phase]
+ return (rValue1, rValue2)
+
+def filter_mergephases(logentries):
+ myphases = EBUILD_PHASES[:]
+ myphases.remove("prerm")
+ myphases.remove("postrm")
+ return filter_phases(logentries, myphases)
+
+def filter_unmergephases(logentries):
+ return filter_phases(logentries, ["prerm", "postrm", "other"])