1 [ This was some notes to myself that I made while removing potato; I
2 kept it because it turned out to be a far more traumatic experience
3 than was necesary. Hopefully rhona will be fixed by the time I need
4 to do this again which would obsolete most of the complex SQL
11 o Create potato copy on archive.debian.org
12 o poolize any not-just-potato files with monica.
13 o force-remove any just-potato files (i.e. by setting last used to 3 weeks ago and run rhona)
14 o remove any files (dists/potato) (NB: not pool symlinks!)
15 o remove oldstable etc. from the db and config files
17 ********************************************************************************
20 SELECT f.id INTO TEMP moo FROM files f, binaries b, bin_associations ba
21 WHERE ba.suite IN (2, 3) AND ba.bin = b.id AND f.id = b.file
23 SELECT f.id FROM files f, binaries b, bin_associations ba
24 WHERE ba.suite NOT IN (2, 3) AND ba.bin = b.id AND f.id = b.file;
26 CREATE INDEX moo_index on moo (id);
27 VACUUM; VACUUM ANALYZE;
29 EXPLAIN UPDATE files set last_used = '2003/09/03'
31 SELECT id FROM moo WHERE files.id = moo.id);
33 DELeditmeETE FROM bin_associations WHERE suite IN (2, 3);
37 ****************************************
41 SELECT f.id INTO TEMP moo FROM files f, source s, src_associations sa, dsc_files df
42 WHERE sa.suite IN (2, 3) AND sa.source = s.id AND df.source = s.id AND df.file = f.id
43 AND NOT EXISTS (SELECT b.id FROM binaries b WHERE b.source = s.id)
45 SELECT f.id FROM files f, source s, src_associations sa, dsc_files df
46 WHERE sa.suite NOT IN (2, 3) AND sa.source = s.id AND df.source = s.id AND df.file = f.id;
48 CREATE INDEX moo_index on moo (id);
49 VACUUM; VACUUM ANALYZE;
51 EXPLAIN UPDATE files set last_used = '2003/09/03'
53 SELECT id FROM moo WHERE files.id = moo.id);
55 DELeditmeETE FROM src_associations WHERE suite IN (2, 3);
59 ********************************************************************************
61 [Code for catherine (poolize); to go after the move of the file]
63 src = utils.clean_symlink(destination, legacy_filename, Cnf["Dir::Root"]);
65 print "Symlinking: %s -> %s" % (legacy_filename, src);
67 os.symlink(src, legacy_filename);
71 SELECT l.path, f.filename, f.id as files_id, c.name as component
72 FROM files f, binaries b, bin_associations ba, location l, component c
73 WHERE ba.suite NOT IN (2, 3) AND f.filename ~ '^potato'
74 AND ba.bin = b.id AND f.id = b.file AND l.id = f.location
75 AND c.id = l.component
77 SELECT DISTINCT ON (f.filename) l.path, f.filename, f.id as files_id, c.name as component
78 FROM files f, source s, src_associations sa, dsc_files df,
79 location l, component c
80 WHERE sa.suite NOT IN (2, 3) AND f.filename ~ '^potato'
81 AND sa.source = s.id AND df.source = s.id AND f.id = df.file
82 AND l.id = f.location AND c.id = l.component;