summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/emergelog.py5
-rw-r--r--pym/_emerge/main.py16
2 files changed, 11 insertions, 10 deletions
diff --git a/pym/_emerge/emergelog.py b/pym/_emerge/emergelog.py
index f30356ea1..87e46e266 100644
--- a/pym/_emerge/emergelog.py
+++ b/pym/_emerge/emergelog.py
@@ -13,8 +13,11 @@ from portage import _unicode_encode
from portage.data import secpass
from portage.output import xtermTitle
+# emergelog is disabled by default, since it's called from
+# dblink.merge() we don't want that to trigger log writes
+# unless it's really called via emerge.
+_disable = True
_emerge_log_dir = '/var/log'
-_disable = False
def emergelog(xterm_titles, mystr, short_msg=None):
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index ea3282a1d..7b9ab6152 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -1746,6 +1746,9 @@ def emerge_main(args=None):
portage_group_warning()
return 1
+ # Disable emergelog for everything except build or unmerge operations.
+ # This helps minimize parallel emerge.log entries that can confuse log
+ # parsers like genlop.
disable_emergelog = False
for x in ("--pretend", "--fetchonly", "--fetch-all-uri"):
if x in myopts:
@@ -1753,14 +1756,10 @@ def emerge_main(args=None):
break
if myaction in ("search", "info"):
disable_emergelog = True
- if disable_emergelog:
- """ Disable emergelog for everything except build or unmerge
- operations. This helps minimize parallel emerge.log entries that can
- confuse log parsers. We especially want it disabled during
- parallel-fetch, which uses --resume --fetchonly."""
- _emerge.emergelog._disable = True
- else:
+ _emerge.emergelog._disable = disable_emergelog
+
+ if not disable_emergelog:
if 'EMERGE_LOG_DIR' in settings:
try:
# At least the parent needs to exist for the lock file.
@@ -1771,8 +1770,7 @@ def emerge_main(args=None):
(settings['EMERGE_LOG_DIR'], e),
noiselevel=-1, level=logging.ERROR)
else:
- global _emerge_log_dir
- _emerge_log_dir = settings['EMERGE_LOG_DIR']
+ _emerge.emergelog._emerge_log_dir = settings["EMERGE_LOG_DIR"]
if not "--pretend" in myopts:
emergelog(xterm_titles, "Started emerge on: "+\