9e2c2e2
From 91d4ad7391a726df61ff083d098f85c1d433d230 Mon Sep 17 00:00:00 2001
9e2c2e2
From: Daniel Mach <dmach@redhat.com>
9e2c2e2
Date: Fri, 13 Aug 2010 10:11:11 +0200
9e2c2e2
Subject: [PATCH] Fix kobo.rpmlib.get_digest_algo_from_header() when RPMTAG_FILEDIGESTALGO contains None value.
9e2c2e2
9e2c2e2
---
9e2c2e2
 kobo/rpmlib.py |    2 +-
9e2c2e2
 1 files changed, 1 insertions(+), 1 deletions(-)
9e2c2e2
9e2c2e2
diff --git a/kobo/rpmlib.py b/kobo/rpmlib.py
9e2c2e2
index 228e80e..817db4a 100644
9e2c2e2
--- a/kobo/rpmlib.py
9e2c2e2
+++ b/kobo/rpmlib.py
9e2c2e2
@@ -329,7 +329,7 @@ def get_digest_algo_from_header(hdr):
9e2c2e2
     hdr_key = getattr(rpm, "RPMTAG_FILEDIGESTALGO", 5011)
9e2c2e2
     algo_id = hdr[hdr_key]
9e2c2e2
 
9e2c2e2
-    if algo_id == []:
9e2c2e2
+    if algo_id == [] or algo_id is None:
9e2c2e2
         # RPMTAG_FILEDIGESTALGO is empty, fall back to md5
9e2c2e2
         algo_id = 1
9e2c2e2
 
9e2c2e2
-- 
9e2c2e2
1.5.5.6
9e2c2e2