summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-10-07 11:43:35 -0700
committerZac Medico <zmedico@gentoo.org>2010-10-07 12:18:03 -0700
commitebd57de9b0abbf249a4e89b26157c60d2d5c31ab (patch)
tree9e2c9d73bef71d7e41e217e4ba875e069de460d2
parent0af611e7692279d3d0f96c45a00ef2d94dbf55ea (diff)
downloadportage-ebd57de9b0abbf249a4e89b26157c60d2d5c31ab.tar.gz
portage-ebd57de9b0abbf249a4e89b26157c60d2d5c31ab.tar.bz2
portage-ebd57de9b0abbf249a4e89b26157c60d2d5c31ab.zip
Add a _preload_elog_modules() function.
-rw-r--r--pym/portage/dbapi/vartree.py4
-rw-r--r--pym/portage/elog/__init__.py14
2 files changed, 16 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 3b845226c..afdb339cb 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -12,7 +12,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'portage.dbapi.dep_expand:dep_expand',
'portage.dep:dep_getkey,isjustname,match_from_list,' + \
'use_reduce,_slot_re',
- 'portage.elog:elog_process',
+ 'portage.elog:elog_process,_preload_elog_modules',
'portage.locks:lockdir,unlockdir',
'portage.output:bold,colorize',
'portage.package.ebuild.doebuild:doebuild_environment,' + \
@@ -3825,7 +3825,7 @@ class dblink(object):
os.chmod(var_new, dir_perms)
os.chmod(base_path_tmp, dir_perms)
# This serves so pre-load the modules.
- elog_process(self.mycpv, self.settings)
+ _preload_elog_modules()
return self._merge(mergeroot, inforoot,
myebuild=myebuild, cleanup=cleanup,
diff --git a/pym/portage/elog/__init__.py b/pym/portage/elog/__init__.py
index 78b6d8398..6bb52d065 100644
--- a/pym/portage/elog/__init__.py
+++ b/pym/portage/elog/__init__.py
@@ -15,6 +15,20 @@ from portage.elog.filtering import filter_loglevels
from portage.localization import _
from portage import os
+def _preload_elog_modules(settings):
+ logsystems = settings.get("PORTAGE_ELOG_SYSTEM", "").split()
+ for s in logsystems:
+ # allow per module overrides of PORTAGE_ELOG_CLASSES
+ if ":" in s:
+ s, levels = s.split(":", 1)
+ levels = levels.split(",")
+ # - is nicer than _ for module names, so allow people to use it.
+ s = s.replace("-", "_")
+ try:
+ _load_mod("portage.elog.mod_" + s)
+ except ImportError:
+ pass
+
def _merge_logentries(a, b):
rValue = {}
phases = set(a)