From: Mike O'Connor Date: Wed, 25 Feb 2009 20:16:22 +0000 (-0500) Subject: another fix to bootstrap, and get rid of 'fetchall' X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e1d5c745350f363d203528acdbd0c74bfc9c7ec;p=dak another fix to bootstrap, and get rid of 'fetchall' Signed-off-by: Mike O'Connor --- diff --git a/dak/contents.py b/dak/contents.py index 5ff121bc..2e24b2b9 100644 --- a/dak/contents.py +++ b/dak/contents.py @@ -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] )