From 1e1d5c745350f363d203528acdbd0c74bfc9c7ec Mon Sep 17 00:00:00 2001 From: Mike O'Connor Date: Wed, 25 Feb 2009 15:16:22 -0500 Subject: [PATCH] another fix to bootstrap, and get rid of 'fetchall' Signed-off-by: Mike O'Connor --- dak/contents.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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] ) -- 2.39.5