summaryrefslogtreecommitdiffstats
path: root/pym/portage/elog/filtering.py
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-06-30 11:21:26 +0000
committerMarius Mauch <genone@gentoo.org>2007-06-30 11:21:26 +0000
commit6e969a709c40e8c78e4961e7ea7e9f045cfb6d92 (patch)
tree53d87ad4ab895cb8c195db58200b250fa4237371 /pym/portage/elog/filtering.py
parent6e4dbc5df61a885fde1912f3a25fe32c6da844d6 (diff)
downloadportage-6e969a709c40e8c78e4961e7ea7e9f045cfb6d92.tar.gz
portage-6e969a709c40e8c78e4961e7ea7e9f045cfb6d92.tar.bz2
portage-6e969a709c40e8c78e4961e7ea7e9f045cfb6d92.zip
apply additional phase filters as otherwise some messages are logged in both unmerge and merge
svn path=/main/trunk/; revision=7098
Diffstat (limited to 'pym/portage/elog/filtering.py')
-rw-r--r--pym/portage/elog/filtering.py21
1 files changed, 21 insertions, 0 deletions
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"])