[yum-commits] Branch 'yum-3_2_X' - yum/pgpmsg.py

James Antill james at osuosl.org
Mon Aug 9 17:50:30 UTC 2010


 yum/pgpmsg.py |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f5a7625e93ee701fd1dc27b04bc040e8113a2e39
Author: James Antill <james at and.org>
Date:   Mon Aug 9 13:26:26 2010 -0400

    Don't break the gpgmsg.decode_msg() API, yum-keys plugin uses this

diff --git a/yum/pgpmsg.py b/yum/pgpmsg.py
index 9cf8217..9f58fad 100644
--- a/yum/pgpmsg.py
+++ b/yum/pgpmsg.py
@@ -1186,7 +1186,7 @@ def decode(msg) :
         idx = idx + pkt_len
     return pkt_list
 
-def decode_msg(msg) :
+def decode_msg(msg, multi=False) :
     """decode_msg(msg) ==> list of OpenPGP "packet" objects
 Takes an ascii-armored PGP block and returns a list of objects each of which
 corresponds to a PGP "packets".
@@ -1242,11 +1242,17 @@ a PGP "certificate" includes a public key, user id(s), and signature.
                 pkt_idx = cert.load(pkt_list)
                 cert_list.append(cert)
                 pkt_list[0:pkt_idx] = []
+            if not multi:
+                if not cert_list:
+                    return None
+                return cert_list[0]
             return cert_list
         
         # add the data to our buffer then
         block_buf.write(l)
 
+    if not multi:
+        return None
     return []
 
 def decode_multiple_keys(msg):


More information about the Yum-commits mailing list