+ # Write the list of files out
+ package_keys = packages.keys();
+ package_keys.sort();
+ for package in package_keys:
+ output.write(packages[package]+'\n')
+
+#########################################################################################
+
+##########
+# <elmo> I'm doing it in python btw.. nothing against your monster
+# SQL, but the python wins in terms of speed and readiblity
+# <aj> bah
+# <aj> you suck!!!!!
+# <elmo> sorry :(
+# <aj> you are not!!!
+# <aj> you mock my SQL!!!!
+# <elmo> you want have contest of skillz??????
+# <aj> all your skillz are belong to my sql!!!!
+# <elmo> yo momma are belong to my python!!!!
+# <aj> yo momma was SQLin' like a pig last night!
+##########
+
+# If something has moved from one component to another we need to
+# clean out the old versions here. The rest of jenna won't do this
+# because it works on a per-component level for flexibility.
+
+def clean_suite (suite):
+ print "Cleaning out packages for %s..." % (suite)
+
+ suite_id = db_access.get_suite_id(suite);
+ q = projectB.query("""
+SELECT b.id, b.package, a.arch_string, b.version, l.path, f.filename, c.name
+ FROM binaries b, bin_associations ba, files f, location l, architecture a, component c
+ WHERE ba.suite = %s AND ba.bin = b.id AND b.file = f.id AND
+ f.location = l.id AND l.component = c.id AND b.architecture = a.id
+UNION
+SELECT s.id, s.source, 'source', s.version, l.path, f.filename, c.name
+ FROM source s, src_associations sa, files f, location l, component c
+ WHERE sa.suite = %s AND sa.source = s.id AND s.file = f.id AND
+ f.location = l.id AND l.component = c.id;""" % (suite_id, suite_id));
+ ql = q.getresult();
+ d = {};
+ for i in ql:
+ (id, package, architecture, version, path, filename, component) = i;
+ filename = path + filename;
+ if architecture == "source":
+ delete_table = "src_associations";
+ delete_col = "source";
+ else:
+ delete_table = "bin_associations";
+ delete_col = "bin";
+ key = "%s~%s" % (package, architecture);