]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
wtf was that
[dak.git] / daklib / dbconn.py
index e651916a186c3907edd3b990f1bc90016908635a..18f427d424222d02fd9e74b4ade827950679003f 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
@@ -2228,6 +2233,7 @@ class DBConn(Singleton):
         mapper(Override, self.tbl_override,
                properties = dict(suite_id = self.tbl_override.c.suite,
                                  suite = relation(Suite),
+                                 package = self.tbl_override.c.package,
                                  component_id = self.tbl_override.c.component,
                                  component = relation(Component),
                                  priority_id = self.tbl_override.c.priority,