Fix for older rpm versions
authorPaul Nasrat <pnasrat@redhat.com>
Fri, 18 May 2007 15:01:16 +0000 (15:01 +0000)
committerPaul Nasrat <pnasrat@redhat.com>
Fri, 18 May 2007 15:01:16 +0000 (15:01 +0000)
Christoph Thiel <cthiel@suse.de>

dumpMetadata.py

index 5041eeead5da37edfb170a696c986590de32f58e..396435a6da134c91a7f8ad5816127ef62cdb8d51 100644 (file)
@@ -587,9 +587,12 @@ class RpmMetaData:
             return getChecksum(self.options['sumtype'], fo)
 
         t = []
-        t.append("".join(self.hdr[rpm.RPMTAG_SIGGPG]))   
-        t.append("".join(self.hdr[rpm.RPMTAG_SIGPGP]))
-        t.append("".join(self.hdr[rpm.RPMTAG_HDRID]))
+        if type(self.hdr[rpm.RPMTAG_SIGGPG]) is not types.NoneType:
+            t.append("".join(self.hdr[rpm.RPMTAG_SIGGPG]))   
+        if type(self.hdr[rpm.RPMTAG_SIGPGP]) is not types.NoneType:
+            t.append("".join(self.hdr[rpm.RPMTAG_SIGPGP]))
+        if type(self.hdr[rpm.RPMTAG_HDRID]) is not types.NoneType:
+            t.append("".join(self.hdr[rpm.RPMTAG_HDRID]))
 
         key = md5.new("".join(t)).hexdigest()