]> git.ipfire.org Git - pakfire.git/commitdiff
Speed up searching for signatures in package files.
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Dec 2012 15:10:49 +0000 (16:10 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 21 Dec 2012 15:10:49 +0000 (16:10 +0100)
python/pakfire/packages/file.py

index 26d91d3b925c7d4cb38ea0708777d0c57b7be698..55f9694505f63d1c1499d976258fc5455b96c7e2 100644 (file)
@@ -544,7 +544,13 @@ class FilePackage(base.Package):
                """
                        Check if the file a signature of the given key.
                """
-               return self.signatures.has_key(key_id)
+               f = self.open_file("signatures/%s" % key_id)
+               if f:
+                       f.close()
+
+                       return True
+
+               return False
 
        def __has_hardlinks(self):
                """