summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-22 18:28:08 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-22 18:28:08 -0700
commit151c890ed2f5c0deb4803206829a2a5227261010 (patch)
treed9663496976a13e50a145e84c5904de7e298086b
parentff53302041af5c6a54ab2fc59bbd1fc81eb0de67 (diff)
downloadportage-151c890ed2f5c0deb4803206829a2a5227261010.tar.gz
portage-151c890ed2f5c0deb4803206829a2a5227261010.tar.bz2
portage-151c890ed2f5c0deb4803206829a2a5227261010.zip
Handle zlib.error when reading compressed build logs via GzipFile.
-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()