]> git.decadent.org.uk Git - dak.git/blob - docs/README.suite-removal
Stop using silly names, and migrate to a saner directory structure.
[dak.git] / docs / README.suite-removal
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
5   crap. (JT) ]
6
7
8                          Potato Removal Plan
9                          -------------------
10
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
16
17 ********************************************************************************
18 DROP TABLE moo;
19
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
22 EXCEPT
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;
25
26 CREATE INDEX moo_index on moo (id);
27 VACUUM; VACUUM ANALYZE;
28
29 EXPLAIN UPDATE files set last_used = '2003/09/03'
30   WHERE EXISTS (
31     SELECT id FROM moo WHERE files.id = moo.id);
32
33 DELeditmeETE FROM bin_associations WHERE suite IN (2, 3);
34
35 [ run rhona ]
36
37 ****************************************
38
39 DROP TABLE moo;
40
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)
44 EXCEPT
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;
47
48 CREATE INDEX moo_index on moo (id);
49 VACUUM; VACUUM ANALYZE;
50
51 EXPLAIN UPDATE files set last_used = '2003/09/03'
52   WHERE EXISTS (
53     SELECT id FROM moo WHERE files.id = moo.id);
54
55 DELeditmeETE FROM src_associations WHERE suite IN (2, 3);
56
57 [ run rhona ]
58
59 ********************************************************************************
60
61 [Code for catherine (poolize); to go after the move of the file]
62 # Create symlink
63 src = utils.clean_symlink(destination, legacy_filename, Cnf["Dir::Root"]);
64 if verbose:
65     print "Symlinking: %s -> %s" % (legacy_filename, src);
66 if not no_action:
67     os.symlink(src, legacy_filename);
68
69
70 [Query for catherine]
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
76 UNION
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;