]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/dbconn.py
Merge commit 'ftpmaster/master'
[dak.git] / daklib / dbconn.py
index 146e8c30ccbb2f248cc64a242076728433fef027..46d4d3d5791c461ffaed84504ea2367fe18e12dc 100755 (executable)
@@ -334,8 +334,6 @@ class DBConn(Singleton):
         elif type(suite) == int:
             suite_id = suite
 
-        print suite_id
-
         return self.__get_single_row("SELECT * FROM suite WHERE id = %(id)s",
                                      {'id': suite_id})
 
@@ -569,11 +567,15 @@ class DBConn(Singleton):
 
         c.execute("BEGIN WORK")
         try:
+            arch_id = self.get_architecture_id(package['Architecture'])
 
-                # Remove any already existing recorded files for this package
+            # Remove any already existing recorded files for this package
             c.execute("""DELETE FROM pending_content_associations
                          WHERE package=%(Package)s
-                         AND version=%(Version)s""", package )
+                         AND version=%(Version)s
+                         AND architecture=%(ArchID)s""", {'Package': package['Package'],
+                                                          'Version': package['Version'],
+                                                          'ArchID':  arch_id})
 
             for fullpath in fullpaths:
                 (path, file) = os.path.split(fullpath)
@@ -585,9 +587,10 @@ class DBConn(Singleton):
                 path_id = self.get_or_set_contents_path_id(path)
 
                 c.execute("""INSERT INTO pending_content_associations
-                               (package, version, filepath, filename)
-                           VALUES (%%(Package)s, %%(Version)s, '%d', '%d')""" % (path_id, file_id),
-                          package )
+                               (package, version, architecture, filepath, filename)
+                            VALUES (%%(Package)s, %%(Version)s, '%d', '%d', '%d')"""
+                    % (arch_id, path_id, file_id), package )
+
             c.execute("COMMIT")
             return True
         except:
@@ -616,7 +619,6 @@ class Suite(object):
         if suite is not None:
             db_conn = DBConn()
             suite_data = db_conn.get_suite(suite)
-            print suite_data
             if suite_data is not None:
                 for k in suite_data.keys():
                     setattr(self, k, suite_data[k])