Commit | Line | Data |
---|---|---|
8d91aae6 RP |
1 | |
2 | ||
3 | The Sanitization Process | |
4 | ||
5 | ||
6 | Usage: | |
7 | ||
8 | To sanitize a directory or subtree, foo: | |
9 | ||
10 | cd foo ; /usr/unsupported/bin/Sanitize | |
11 | ||
12 | and you should be left with source code free of any distribution | |
13 | restrictions. | |
14 | ||
15 | ||
16 | Configuration: | |
17 | ||
18 | Each directory to be kept in a release should have a .Sanitize file in | |
19 | cvs. See devo/.Sanitize for a more or less self describing template. | |
20 | ||
184d260b JK |
21 | All files should be listed in "Things-to-keep:" or "Things-to-lose:" |
22 | (or dealt with via keep_these_too and lose_these_too, see below). If | |
23 | a file is not listed, it is removed, but a warning is printed. | |
8d91aae6 RP |
24 | Directories that are kept will have Sanitize called on their own |
25 | .Sanitize files. | |
26 | ||
8d91aae6 RP |
27 | The "Do-first:" section of .Sanitize should be a shell script |
28 | fragment. It will be sourced by the Sanitize shell script after | |
29 | verifying that the .Sanitize file looks reasonable but before taking | |
30 | any other action. The arguments to Sanitize are passed to this | |
31 | fragment so that you can take conditional action. For an example of | |
d12a71ca | 32 | its use, see devo/gcc/config/.Sanitize. |
8d91aae6 RP |
33 | |
34 | If the "Do-first:" section sets the local shell variable | |
35 | "keep_these_too", the files and/or directories listed there will be | |
184d260b JK |
36 | kept in addition to any files listed in "Things-to-keep:". If it sets |
37 | "lose_these_too", those files and/or directories will be removed in | |
38 | addition to any files listed in "Things-to-lose:". For an example of | |
39 | its use, see devo/gcc/config/.Sanitize. | |
8d91aae6 RP |
40 | |
41 | The "Do-last:" section of .Sanitize should be a shell script fragment. | |
42 | It will be sourced by Sanitize after all other action is taken for | |
43 | this directory. This section is intended to be used to strip code out | |
44 | of source files. For an example of grep'ing out specific lines, see | |
45 | devo/include/.Sanitize. For an example of sed'ing out sections of | |
46 | code, see devo/gas/config/.Sanitize. | |
47 | ||
48 | Command line options are extremely free form. The Sanitize script | |
49 | itself only knows about keep-cvs. All arguments to Sanitize are | |
50 | passed to the "Do-first:" and "Do-last:" fragments. Feel free to add | |
51 | new options as you see fit so long as you list them here. | |
52 | ||
53 | Defined options: | |
54 | ||
55 | keep-cvs avoids removing CVS.adm directories. This option is | |
56 | actually recognized and handled by the Sanitize shell | |
57 | script. | |
58 | ||
d12a71ca | 59 | keep-cygnus avoids removing Cygnus-only bits. |
8d91aae6 RP |
60 | keep-v9 avoids removing the v9 stuff. |
61 | keep-life avoids removing the life stuff. | |
62 | keep-cri avoids removing the cray research inc changes to emacs. | |
d12a71ca SS |
63 | keep-chill avoids removing CHILL support. |
64 | keep-mpw avoids removing MPW host support. | |
65 | keep-gm avoids removing GM-specific stuff. | |
d12a71ca | 66 | |
8d91aae6 RP |
67 | for-intel builds a distribution in the style that Intel likes. |
68 | for-fsf builds a distribution in the style that the FSF likes. | |
69 | ||
70 | test instead of removing dirty files, cache them away in a | |
71 | .Recover directory | |
72 | recover intended to undo the effects of a "Sanitize test". |