summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/_emerge/Scheduler.py4
-rw-r--r--pym/portage/package/ebuild/doebuild.py8
2 files changed, 12 insertions, 0 deletions
diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py
index aa0a40290..6979551a3 100644
--- a/pym/_emerge/Scheduler.py
+++ b/pym/_emerge/Scheduler.py
@@ -12,6 +12,7 @@ import tempfile
import textwrap
import time
import weakref
+import zlib
import portage
from portage import StringIO
@@ -1096,6 +1097,9 @@ class Scheduler(PollScheduler):
try:
for line in log_file:
writemsg_level(line, noiselevel=-1)
+ except zlib.error as e:
+ writemsg_level("%s\n" % (e,), level=logging.ERROR,
+ noiselevel=-1)
finally:
log_file.close()
failure_log_shown = True
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index b340e2759..7a00cfffe 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -16,6 +16,7 @@ import sys
import tempfile
from textwrap import wrap
import time
+import zlib
import portage
portage.proxy.lazyimport.lazyimport(globals(),
@@ -1213,6 +1214,10 @@ def _check_build_log(mysettings, out=None):
re.compile(r'g?make\[\d+\]: warning: jobserver unavailable:')
make_jobserver = []
+ def _eerror(lines):
+ for line in lines:
+ eerror(line, phase="install", key=mysettings.mycpv, out=out)
+
try:
for line in f:
line = _unicode_decode(line)
@@ -1233,6 +1238,9 @@ def _check_build_log(mysettings, out=None):
if make_jobserver_re.match(line) is not None:
make_jobserver.append(line.rstrip("\n"))
+ except zlib.error as e:
+ _eerror(["portage encounted a zlib error: '%s'" % (e,),
+ "while reading the log file: '%s'" % logfile])
finally:
f.close()