pld-builder.new: PLD_Builder/gpg.py Try to log gnupg verification/...

arekm arekm at pld-linux.org
Fri Feb 9 14:42:20 CET 2007


Author: arekm                        Date: Fri Feb  9 13:42:20 2007 GMT
Module: pld-builder.new               Tag: HEAD
---- Log message:
Try to log gnupg verification/signing failures.

---- Files affected:
pld-builder.new/PLD_Builder:
   gpg.py (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: pld-builder.new/PLD_Builder/gpg.py
diff -u pld-builder.new/PLD_Builder/gpg.py:1.10 pld-builder.new/PLD_Builder/gpg.py:1.11
--- pld-builder.new/PLD_Builder/gpg.py:1.10	Wed Mar  1 17:52:27 2006
+++ pld-builder.new/PLD_Builder/gpg.py	Fri Feb  9 14:42:15 2007
@@ -1,5 +1,6 @@
 # vi: encoding=utf-8 ts=8 sts=4 sw=4 et
 
+import log
 import popen2
 import re
 import StringIO
@@ -15,7 +16,12 @@
     object.
     """
     (gpg_out, gpg_in, gpg_err) = popen2.popen3("gpg --batch --no-tty --decrypt")
-    body = pipeutil.rw_pipe(buf, gpg_in, gpg_out)
+    try:
+        body = pipeutil.rw_pipe(buf, gpg_in, gpg_out)
+    except OSError:
+        log.error("gnupg signing failed; does gpg binary exist?")
+        raise
+
     rx = re.compile("^gpg: (Good signature from|                aka) .*<([^>]+)>")
     emails = []
     for l in gpg_err.xreadlines():
@@ -27,6 +33,11 @@
 
 def sign(buf):
     (gpg_out, gpg_in, gpg_err) = popen2.popen3("gpg --batch --no-tty --clearsign")
-    body = pipeutil.rw_pipe(buf, gpg_in, gpg_out)
+    try:
+        body = pipeutil.rw_pipe(buf, gpg_in, gpg_out)
+    except OSError:
+        log.error("gnupg signing failed; does gpg binary exist?")
+        raise
+
     gpg_err.close()
     return body
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/pld-builder.new/PLD_Builder/gpg.py?r1=1.10&r2=1.11&f=u



More information about the pld-cvs-commit mailing list