- session.execute("""INSERT INTO bin_associations (suite, bin)
- VALUES (:suiteid, :pkid)""", {'suiteid': suite_id, 'pkid': pkid})
- Logger.log(["added", key, pkid])
+ transaction.copy_binary(pkg, suite, component)
+
+ Logger.log(["added", " ".join(key)])
+
+ # Check to see which packages need removed and remove them
+ for key, pkid in current.iteritems():
+ if key not in desired:
+ (package, version, architecture) = key
+ if architecture == "source":
+ session.execute("""DELETE FROM src_associations WHERE id = :pkid""", {'pkid': pkid})
+ else:
+ session.execute("""DELETE FROM bin_associations WHERE id = :pkid""", {'pkid': pkid})
+ Logger.log(["removed", " ".join(key), pkid])