summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/elog/__init__.py15
-rw-r--r--pym/portage/elog/filtering.py21
2 files changed, 34 insertions, 2 deletions
diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py
index cbe9f47fa..ef040faa9 100644
--- a/pym/portage/elog/__init__.py
+++ b/pym/portage/elog/__init__.py
@@ -41,7 +41,8 @@ def _combine_logentries(logentries):
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):
@@ -49,8 +50,18 @@ def elog_process(cpv, mysettings):
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)
diff --git a/pym/portage/elog/filtering.py b/pym/portage/elog/filtering.py
index e8a5430fd..b41f64e48 100644
--- a/pym/portage/elog/filtering.py
+++ b/pym/portage/elog/filtering.py
@@ -3,6 +3,8 @@
# 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 = {}
@@ -15,3 +17,22 @@ def filter_loglevels(logentries, loglevels):
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"])