+ key = " ".join(split_line);
+ desired[key] = "";
+
+ # Check to see which packages need removed and remove them
+ for key in current.keys():
+ if not desired.has_key(key):
+ (package, version, architecture) = key.split();
+ id = current[key];
+ if architecture == "source":
+ q = projectB.query("DELETE FROM src_associations WHERE id = %s" % (id));
+ else:
+ q = projectB.query("DELETE FROM bin_associations WHERE id = %s" % (id));
+ Logger.log(["removed",key,id]);
+
+ # Check to see which packages need added and add them
+ for key in desired.keys():
+ if not current.has_key(key):
+ (package, version, architecture) = key.split();
+ id = get_id (package, version, architecture);
+ if not id:
+ continue;
+ if architecture == "source":
+ q = projectB.query("INSERT INTO src_associations (suite, source) VALUES (%s, %s)" % (suite_id, id));
+ else:
+ q = projectB.query("INSERT INTO bin_associations (suite, bin) VALUES (%s, %s)" % (suite_id, id));
+ Logger.log(["added",key,id]);