3 # Each directory to survive its way into a release will need a file
4 # like this one called "./.Sanitize". All keyword lines must exist,
5 # and must exist in the order specified by this file. Each directory
6 # in the tree will be processed, top down, in the following order.
8 # Hash started lines like this one are comments and will be deleted
9 # before anything else is done. Blank lines will also be squashed
12 # The lines between the "Do-first:" line and the "Things-to-keep:"
13 # line are executed as a /bin/sh shell script before anything else is
14 # done in this directory.
18 keep_these_too="${keep_these_too} .cvsignore CYGNUS autoconf
19 bfd binutils byacc cvs deja-gnu dejagnu diff dosrel dvips emacs emacs19
20 examples expect fileutils flex gas gcc gdb gdbm gdbtest glob gprof grep
21 groff include install.sh ispell ld libg++ libgcc libgloss libiberty
22 libio librx libstdc++ m4 make mmalloc move-if-change newlib opcodes
23 pagas patch prms rcs readline sed send-pr shellutils sim tcl textutils
24 tk test-build.mk texinfo tgas utils uudecode wdiff xiberty"
26 cygnus_files="release release-info build-all.mk COPYING.NEWLIB"
28 if ( echo $* | grep keep\-cygnus > /dev/null) ; then
29 keep_these_too="${keep_these_too} ${cygnus_files}"
31 lose_these_too="${lose_these_too} ${cygnus_files}"
34 mpw_files="mpw-README mpw-configure mpw-config.in mpw-build.in ChangeLog.mpw"
36 if ( echo $* | grep keep\-mpw > /dev/null) ; then
37 keep_these_too="${keep_these_too} ${mpw_files}"
38 if [ -n "${verbose}" ] ; then
39 echo Keeping ${mpw_files}
42 lose_these_too="${lose_these_too} ${mpw_files}"
43 if [ -n "${verbose}" ] ; then
44 echo Deleting ${mpw_files}
50 if ( echo $* | grep lose\-gdbtk > /dev/null) ; then
51 lose_these_too="${lose_these_too} ${gdbtk_files}"
52 if [ -n "${verbose}" ] ; then
53 echo Deleting ${gdbtk_files}
56 keep_these_too="${keep_these_too} ${gdbtk_files}"
57 if [ -n "${verbose}" ] ; then
58 echo Keeping ${gdbtk_files}
62 # This top-level directory is special. We often check out only subsets
63 # of this directory, and complaining about directories or files we didn't
64 # check out just gets obnoxious.
66 list="${keep_these_too}"
69 for file in $list ; do
70 if [ -r $file ] || [ -d $file ] ; then
71 keep_these_too="${keep_these_too} $file"
75 list="${lose_these_too}"
78 for file in $list ; do
79 if [ -r $file ] || [ -d $file ] ; then
80 lose_these_too="${lose_these_too} $file"
84 # All files listed between the "Things-to-keep:" line and the
85 # "Do-last:" line will be kept. All other files will be removed.
86 # Directories listed in this section will have their own Sanitize
87 # called. Directories not listed will be removed in their entirety
103 # These will only show up if they checked out gas-extra-stuff.
109 # The lines between the "Do-last:" line and the end of the file
110 # are executed as a /bin/sh shell script after everything else is
115 # Don't try to clean directories here, as the 'mv' command will fail.
116 # Also, grep fails on NFS mounted directories.
118 if ( echo $* | egrep verbose > /dev/null ) ; then
124 # Remove "sanitize-Sanitize" lines.
125 if [ -n "${verbose}" ] ; then
126 echo Cleaning unconditional sanitizations out of Makefile.in...
129 sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
130 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
131 mv Makefile.in .Recover
135 if [ -n "${verbose}" ] ; then
136 echo Thawing away the \"chill\"...
139 if ( echo $* | grep keep\-chill > /dev/null ) ; then
141 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
142 if [ -n "${verbose}" ] ; then
143 echo Keeping chill stuff in $i
149 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
150 if [ -n "${verbose}" ] ; then
151 echo Thawing the \"chill\" out of $i...
154 sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
155 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
156 if [ -n "${verbose}" ] ; then
157 echo Caching $i in .Recover...
166 if [ -n "${verbose}" ] ; then
167 echo Removing traces of \"mpw\"...
170 if ( echo $* | grep keep\-mpw > /dev/null ) ; then
172 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
173 if [ -n "${verbose}" ] ; then
174 echo Keeping mpw stuff in $i
180 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
181 if [ -n "${verbose}" ] ; then
182 echo Removing traces of \"mpw\" from $i...
185 sed '/start\-sanitize\-mpw/,/end-\sanitize\-mpw/d' < $i > new
186 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
187 if [ -n "${verbose}" ] ; then
188 echo Caching $i in .Recover...
197 if [ -n "${verbose}" ] ; then
198 echo Processing \"arc\"...
201 arc_files="config.sub configure.in"
203 if ( echo $* | grep keep\-arc > /dev/null ) ; then
204 for i in $arc_files ; do
205 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
206 if [ -n "${verbose}" ] ; then
207 echo Keeping arc stuff in $i
213 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
214 if [ -n "${verbose}" ] ; then
215 echo Removing traces of \"arc\" from $i...
218 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
219 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
220 if [ -n "${verbose}" ] ; then
221 echo Caching $i in .Recover...
230 psion_files="config.sub configure.in"
232 if ( echo $* | grep keep\-psion > /dev/null ) ; then
233 for i in $psion_files; do
234 if test ! -d $i && (grep sanitize-psion $i > /dev/null) ; then
235 if [ -n "${verbose}" ] ; then
236 echo Keeping psion stuff in $i
242 if test ! -d $i && (grep sanitize-psion $i > /dev/null) ; then
243 if [ -n "${verbose}" ] ; then
244 echo Removing traces of \"psion\" from $i...
247 sed '/start\-sanitize\-psion/,/end-\sanitize\-psion/d' < $i > new
248 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
249 if [ -n "${verbose}" ] ; then
250 echo Caching $i in .Recover...
259 rce_files="config.sub"
261 if ( echo $* | grep keep\-rce > /dev/null ) ; then
262 for i in $rce_files ; do
263 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
264 if [ -n "${verbose}" ] ; then
265 echo Keeping rce stuff in $i
270 for i in $rce_files ; do
271 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
272 if [ -n "${verbose}" ] ; then
273 echo Removing traces of \"rce\" from $i...
276 sed '/start\-sanitize\-rce/,/end-\sanitize\-rce/d' < $i > new
277 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
278 if [ -n "${verbose}" ] ; then
279 echo Caching $i in .Recover...
289 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
290 echo '***' Some mentions of Sanitize are still left in $i! 1>&2