[Yum-devel] [PATCH 1/2] Use the correct test to see if the INSERT worked, needed for RHEL-5 sqlite.

James Antill james at and.org
Tue Sep 20 15:58:40 UTC 2011


---
 yum/history.py |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/yum/history.py b/yum/history.py
index a9b12cf..bbd9bf2 100644
--- a/yum/history.py
+++ b/yum/history.py
@@ -1296,10 +1296,8 @@ class YumHistory:
         sql = """INSERT INTO pkg_%(db)sdb (pkgtupid, %(db)sdb_key, %(db)sdb_val)
                         VALUES (?, ?, ?)""" % {'db' : db}
         executeSQL(cur, sql, (pid, attr, to_unicode(val)))
-        for row in cur:
-            return row[0]
 
-        return None
+        return cur.lastrowid
 
     def _save_rpmdb_key(self, pkg, attr, val):
         return self._save_anydb_key(pkg, "rpm", attr, val)
-- 
1.7.6.2



More information about the Yum-devel mailing list