[yum-git] Branch 'yum-3_2_X' - yum/misc.py

James Antill james at linux.duke.edu
Fri Aug 8 15:43:43 UTC 2008


 yum/misc.py |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 32a56ff73170983e812a364a95258c6019c63cc9
Author: James Antill <james at and.org>
Date:   Fri Aug 8 11:41:55 2008 -0400

    Fail valid_detached_sig if gpgme isn't installed

diff --git a/yum/misc.py b/yum/misc.py
index 9314390..daa948a 100644
--- a/yum/misc.py
+++ b/yum/misc.py
@@ -382,6 +382,9 @@ def return_keyids_from_pubring(gpgdir):
 def valid_detached_sig(sig_file, signed_file, gpghome=None):
     """takes signature , file that was signed and an optional gpghomedir"""
 
+    if gpgme is None:
+        return False
+
     if gpghome and os.path.exists(gpghome):
         os.environ['GNUPGHOME'] = gpghome
 
@@ -395,14 +398,14 @@ def valid_detached_sig(sig_file, signed_file, gpghome=None):
     except gpgme.GpgmeError, e:
         return False
     else:
-        thissig = sigs[0] # is there ever a case where we care about a sig beyond the first one?
-        if thissig:
-            if thissig.validity in (gpgme.VALIDITY_FULL,
-                                gpgme.VALIDITY_MARGINAL,
+        # is there ever a case where we care about a sig beyond the first one?
+        thissig = sigs[0]
+        if not thissig:
+            return False
+
+        if thissig.validity in (gpgme.VALIDITY_FULL, gpgme.VALIDITY_MARGINAL,
                                 gpgme.VALIDITY_ULTIMATE):
-                return True
-            else:
-                return False
+            return True
 
     return False
 



More information about the Yum-cvs-commits mailing list