Add verboseness to mpw sanitize, add lose-gdbtk for FSF releases
[deliverable/binutils-gdb.git] / .Sanitize
CommitLineData
43e36dd2 1# .Sanitize for devo.
a93b3c77 2
5db7ecb7 3# Each directory to survive its way into a release will need a file
a93b3c77
RP
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.
7
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
10# out.
11
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
43e36dd2 14# done in this directory.
a93b3c77
RP
15
16Do-first:
17
1ed0529e 18keep_these_too="${keep_these_too} .cvsignore CYGNUS autoconf
e03b0bca
KR
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
f38cb096
JM
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"
e03b0bca 25
1ed0529e 26cygnus_files="release release-info build-all.mk COPYING.NEWLIB"
96c805d8 27
7d0eab7b 28if ( echo $* | grep keep\-cygnus > /dev/null) ; then
96c805d8 29 keep_these_too="${keep_these_too} ${cygnus_files}"
80cad9cc 30else
96c805d8 31 lose_these_too="${lose_these_too} ${cygnus_files}"
7d0eab7b
DZ
32fi
33
eccc57e5 34mpw_files="mpw-README mpw-configure mpw-config.in mpw-build.in ChangeLog.mpw"
96c805d8 35
5db7ecb7 36if ( echo $* | grep keep\-mpw > /dev/null) ; then
96c805d8 37 keep_these_too="${keep_these_too} ${mpw_files}"
fc5a05e9
SS
38 if [ -n "${verbose}" ] ; then
39 echo Keeping ${mpw_files}
40 fi
5db7ecb7 41else
96c805d8 42 lose_these_too="${lose_these_too} ${mpw_files}"
fc5a05e9
SS
43 if [ -n "${verbose}" ] ; then
44 echo Deleting ${mpw_files}
45 fi
46fi
47
48gdbtk_files="tcl tk"
49
50if ( 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}
54 fi
55else
56 keep_these_too="${keep_these_too} ${gdbtk_files}"
57 if [ -n "${verbose}" ] ; then
58 echo Keeping ${gdbtk_files}
59 fi
5db7ecb7 60fi
7d0eab7b 61
e03b0bca
KR
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.
65
66list="${keep_these_too}"
67keep_these_too=
68
69for file in $list ; do
70 if [ -r $file ] || [ -d $file ] ; then
71 keep_these_too="${keep_these_too} $file"
72 fi
73done
74
75list="${lose_these_too}"
76lose_these_too=
77
78for file in $list ; do
79 if [ -r $file ] || [ -d $file ] ; then
80 lose_these_too="${lose_these_too} $file"
81 fi
82done
83
a93b3c77 84# All files listed between the "Things-to-keep:" line and the
43e36dd2 85# "Do-last:" line will be kept. All other files will be removed.
a93b3c77
RP
86# Directories listed in this section will have their own Sanitize
87# called. Directories not listed will be removed in their entirety
88# with rm -rf.
89
90Things-to-keep:
91
6e37b215
PB
92COPYING
93COPYING.LIB
57d32184 94ChangeLog
a93b3c77 95Makefile.in
965a9f14 96README
a93b3c77 97config
5cc24596 98config.guess
db2de419 99config.sub
a93b3c77
RP
100configure
101configure.in
701df845 102etc
3be6e47e 103# These will only show up if they checked out gas-extra-stuff.
16004cc8
KR
104configure.bat
105makeall.bat
a93b3c77 106
87756e15
RP
107Things-to-lose:
108
43e36dd2
RP
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
111# done.
112
a93b3c77
RP
113Do-last:
114
bf150019
DE
115# Don't try to clean directories here, as the 'mv' command will fail.
116# Also, grep fails on NFS mounted directories.
117
7b85349f
RP
118if ( echo $* | egrep verbose > /dev/null ) ; then
119 verbose=true
120else
121 verbose=
122fi
123
eecef7ef
FF
124# Remove "sanitize-Sanitize" lines.
125if [ -n "${verbose}" ] ; then
126 echo Cleaning unconditional sanitizations out of Makefile.in...
127fi
128cp Makefile.in new
129sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
130if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
131 mv Makefile.in .Recover
132fi
133mv new Makefile.in
134
7b85349f
RP
135if [ -n "${verbose}" ] ; then
136 echo Thawing away the \"chill\"...
137fi
5d4ec851 138
5d4ec851
FF
139if ( echo $* | grep keep\-chill > /dev/null ) ; then
140 for i in * ; do
141 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
7b85349f
RP
142 if [ -n "${verbose}" ] ; then
143 echo Keeping chill stuff in $i
144 fi
5d4ec851
FF
145 fi
146 done
147else
148 for i in * ; do
149 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
7b85349f
RP
150 if [ -n "${verbose}" ] ; then
151 echo Thawing the \"chill\" out of $i...
152 fi
5d4ec851
FF
153 cp $i new
154 sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
155 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
7b85349f
RP
156 if [ -n "${verbose}" ] ; then
157 echo Caching $i in .Recover...
158 fi
5d4ec851
FF
159 mv $i .Recover
160 fi
161 mv new $i
162 fi
163 done
5d4ec851
FF
164fi
165
5db7ecb7
SS
166if [ -n "${verbose}" ] ; then
167 echo Removing traces of \"mpw\"...
168fi
169
5db7ecb7
SS
170if ( echo $* | grep keep\-mpw > /dev/null ) ; then
171 for i in * ; do
172 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
173 if [ -n "${verbose}" ] ; then
174 echo Keeping mpw stuff in $i
175 fi
176 fi
177 done
178else
179 for i in * ; do
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...
183 fi
184 cp $i new
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...
189 fi
190 mv $i .Recover
191 fi
192 mv new $i
193 fi
194 done
195fi
196
86118528
KR
197if [ -n "${verbose}" ] ; then
198 echo Processing \"arc\"...
199fi
200
bf150019
DE
201arc_files="config.sub configure.in"
202
86118528 203if ( echo $* | grep keep\-arc > /dev/null ) ; then
bf150019 204 for i in $arc_files ; do
86118528
KR
205 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
206 if [ -n "${verbose}" ] ; then
207 echo Keeping arc stuff in $i
208 fi
209 fi
210 done
211else
212 for i in * ; do
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...
216 fi
217 cp $i new
218 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
bf150019
DE
219 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
220 if [ -n "${verbose}" ] ; then
221 echo Caching $i in .Recover...
222 fi
223 mv $i .Recover
224 fi
225 mv new $i
226 fi
227 done
228fi
229
230psion_files="config.sub configure.in"
231
232if ( 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
237 fi
238 fi
239 done
240else
241 for i in * ; do
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...
245 fi
246 cp $i new
247 sed '/start\-sanitize\-psion/,/end-\sanitize\-psion/d' < $i > new
86118528
KR
248 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
249 if [ -n "${verbose}" ] ; then
250 echo Caching $i in .Recover...
251 fi
252 mv $i .Recover
253 fi
254 mv new $i
255 fi
256 done
257fi
258
03c4ce2f 259rce_files="config.sub"
5c680afd 260
03c4ce2f
MT
261if ( 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
5c680afd 264 if [ -n "${verbose}" ] ; then
03c4ce2f 265 echo Keeping rce stuff in $i
5c680afd
MT
266 fi
267 fi
268 done
269else
03c4ce2f
MT
270 for i in $rce_files ; do
271 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
5c680afd 272 if [ -n "${verbose}" ] ; then
03c4ce2f 273 echo Removing traces of \"rce\" from $i...
5c680afd
MT
274 fi
275 cp $i new
03c4ce2f 276 sed '/start\-sanitize\-rce/,/end-\sanitize\-rce/d' < $i > new
5c680afd
MT
277 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
278 if [ -n "${verbose}" ] ; then
279 echo Caching $i in .Recover...
280 fi
281 mv $i .Recover
282 fi
283 mv new $i
284 fi
285 done
286fi
287
e11b54be
PB
288for i in * ; do
289 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
7b85349f 290 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
e11b54be
PB
291 fi
292done
57d32184
RP
293
294# eof
This page took 0.132749 seconds and 4 git commands to generate.