]> err.no Git - dak/commitdiff
another fix to bootstrap, and get rid of 'fetchall'
authorMike O'Connor <stew@vireo.org>
Wed, 25 Feb 2009 20:16:22 +0000 (15:16 -0500)
committerMike O'Connor <stew@vireo.org>
Wed, 25 Feb 2009 20:16:22 +0000 (15:16 -0500)
Signed-off-by: Mike O'Connor <stew@vireo.org>
dak/contents.py

index 5ff121bc76684668f542646e02604ba27bfc2231..2e24b2b9739aacc55974770b00f9bc71ece27c2a 100644 (file)
@@ -263,18 +263,21 @@ class Contents(object):
             for arch_id in arch_list:
                 cursor.execute( "EXECUTE debs_q(%d, %d)" % ( suite_id, arch_id[0] ) )
 
-                debs = cursor.fetchall()
                 count = 0
-                for deb in debs:
+                while True:
+                    deb = cursor.fetchone()
+                    if not deb:
+                        break
                     count += 1
-                    cursor.execute( "EXECUTE olddeb_q(%d)" % (deb[0] ) )
-                    old = cursor.fetchone()
+                    cursor1 = DBConn().cursor();
+                    cursor1.execute( "EXECUTE olddeb_q(%d)" % (deb[0] ) )
+                    old = cursor1.fetchone()
                     if old:
                         log.debug( "already imported: %s" % deb[1] )
                     else:
                         debfile = os.path.join( pooldir, deb[1] )
                         if os.path.exists( debfile ):
-                            Binary(f).scan_package( deb[0] )
+                            Binary(debfile).scan_package( deb[0] )
                         else:
                             log.error( "missing .deb: %s" % deb[1] )