Make ebuild-ipc show an additional 'read failed' message if the buffer
authorZac Medico <zmedico@gentoo.org>
Mon, 20 Sep 2010 23:34:08 +0000 (16:34 -0700)
committerZac Medico <zmedico@gentoo.org>
Mon, 20 Sep 2010 23:34:08 +0000 (16:34 -0700)
happens to be empty after the read loop.

bin/ebuild-ipc.py

index 76e64329b05945375c426e1be76d91322dc28f3a..e353dc4dff2049332f42ddd35ceda7c7b14ad25b 100755 (executable)
@@ -159,7 +159,14 @@ class EbuildIpc(object):
 
                rval = 2
 
-               if buf:
+               if not buf:
+
+                       portage.util.writemsg_level(
+                               "ebuild-ipc: %s\n" % \
+                               (portage.localization._('read failed'),),
+                               level=logging.ERROR, noiselevel=-1)
+
+               else:
 
                        try:
                                reply = pickle.loads(buf.tostring())