X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fdbconn.py;h=46d4d3d5791c461ffaed84504ea2367fe18e12dc;hb=010895777842727186f4e1f8e9c50f9fe19281d2;hp=b4db81903a13054bb8cfcde8cc10b00bb57d3a57;hpb=c7810cbca9ba2e1c52b953773f4cc10add3895fd;p=dak.git diff --git a/daklib/dbconn.py b/daklib/dbconn.py index b4db8190..46d4d3d5 100755 --- a/daklib/dbconn.py +++ b/daklib/dbconn.py @@ -567,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) @@ -583,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: