]> err.no Git - dak/commitdiff
switch execute to executemany for insert_content_paths
authorMike O'Connor <stew@dhcp-101.dfw1.kickstart.lan>
Fri, 30 Oct 2009 14:48:45 +0000 (14:48 +0000)
committerMike O'Connor <stew@dhcp-101.dfw1.kickstart.lan>
Fri, 30 Oct 2009 14:48:45 +0000 (14:48 +0000)
daklib/.#dbconn.py [new symlink]
daklib/dbconn.py

diff --git a/daklib/.#dbconn.py b/daklib/.#dbconn.py
new file mode 120000 (symlink)
index 0000000..a8c5360
--- /dev/null
@@ -0,0 +1 @@
+stew@flotow.debconf.org.25417:1240153710
\ No newline at end of file
index e651916a186c3907edd3b990f1bc90016908635a..47f4e5f2758de6536b1d2886126b18ed2dc984a5 100755 (executable)
@@ -611,11 +611,16 @@ def insert_content_paths(binary_id, fullpaths, session=None):
     try:
         # Insert paths
         pathcache = {}
-        for fullpath in fullpaths:
-            if fullpath.startswith( './' ):
-                fullpath = fullpath[2:]
 
-            session.execute( "INSERT INTO bin_contents ( file, binary_id ) VALUES ( :filename, :id )", { 'filename': fullpath, 'id': binary_id}  )
+        def generate_path_dicts():
+            for fullpath in fullpaths:
+                if fullpath.startswith( './' ):
+                    fullpath = fullpath[2:]
+
+                yield {'fulename':fullpath, 'id': binary_id }
+
+        session.execute( "INSERT INTO bin_contents ( file, binary_id ) VALUES ( :filename, :id )",
+                         generate_path_dicts() )
 
         session.commit()
         if privatetrans:
@@ -1244,7 +1249,7 @@ def insert_pending_content_paths(package,
             pca.file = fullpath
             pca.architecture = arch_id
 
-            if isudeb: 
+            if isudeb:
                 pca.type = 8 # gross
             else:
                 pca.type = 7 # also gross