1 # .Sanitize for devo/gas
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.
19 for d in obsolete regress regress.m68k testscripts ; do
21 lose_these_too="${lose_these_too} $d"
25 # Remember the current list of files in config.
26 if test -d config; then
27 gas_config_files=`cd config; echo *`
32 # All files listed between the "Things-to-keep:" line and the
33 # "Do-last:" line will be kept. All other files will be removed.
34 # Directories listed in this section will have their own Sanitize
35 # called. Directories not listed will be removed in their entirety
134 # The lines between the "Do-last:" line and the end of the file
135 # are executed as a /bin/sh shell script after everything else is
140 r5900_files="ChangeLog ChangeLog-9697 configure configure.in"
141 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
142 for i in $r5900_files ; do
143 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
144 if [ -n "${verbose}" ] ; then
145 echo Keeping r5900 stuff in $i
150 for i in $r5900_files ; do
151 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
152 if [ -n "${verbose}" ] ; then
153 echo Removing traces of \"r5900\" from $i...
156 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
157 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
158 if [ -n "${verbose}" ] ; then
159 echo Caching $i in .Recover...
168 cygnus_files="ChangeLog ChangeLog-9697 configure.in configure"
169 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
170 for i in $cygnus_files ; do
171 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
172 if [ -n "${verbose}" ] ; then
173 echo Keeping cygnus stuff in $i
178 for i in $cygnus_files ; do
179 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
180 if [ -n "${verbose}" ] ; then
181 echo Removing traces of \"cygnus\" from $i...
184 sed '/start\-sanitize\-cygnus/,/end-\sanitize\-cygnus/d' < $i > new
185 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
186 if [ -n "${verbose}" ] ; then
187 echo Caching $i in .Recover...
196 tx19_files="ChangeLog ChangeLog-9697"
197 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
198 for i in $tx19_files ; do
199 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
200 if [ -n "${verbose}" ] ; then
201 echo Keeping tx19 stuff in $i
206 for i in $tx19_files ; do
207 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
208 if [ -n "${verbose}" ] ; then
209 echo Removing traces of \"tx19\" from $i...
212 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
213 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
214 if [ -n "${verbose}" ] ; then
215 echo Caching $i in .Recover...
224 tx49_files="ChangeLog ChangeLog-9697"
225 if ( echo $* | grep keep\-tx49 > /dev/null ) ; then
226 for i in $tx49_files ; do
227 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
228 if [ -n "${verbose}" ] ; then
229 echo Keeping tx49 stuff in $i
234 for i in $tx49_files ; do
235 if test ! -d $i && (grep sanitize-tx49 $i > /dev/null) ; then
236 if [ -n "${verbose}" ] ; then
237 echo Removing traces of \"tx49\" from $i...
240 sed '/start\-sanitize\-tx49/,/end-\sanitize\-tx49/d' < $i > new
241 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
242 if [ -n "${verbose}" ] ; then
243 echo Caching $i in .Recover...
252 tic80_files="ChangeLog ChangeLog-9697 configure.in configure"
253 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
254 for i in $tic80_files ; do
255 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
256 if [ -n "${verbose}" ] ; then
257 echo Keeping tic80 stuff in $i
262 for i in $tic80_files ; do
263 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
264 if [ -n "${verbose}" ] ; then
265 echo Removing traces of \"tic80\" from $i...
268 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
269 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
270 if [ -n "${verbose}" ] ; then
271 echo Caching $i in .Recover...
280 fr30_files="ChangeLog configure.in configure Makefile.am Makefile.in"
281 if ( echo $* | grep keep\-fr30 > /dev/null ) ; then
282 for i in $fr30_files ; do
283 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
284 if [ -n "${verbose}" ] ; then
285 echo Keeping fr30 stuff in $i
290 for i in $fr30_files ; do
291 if test ! -d $i && (grep sanitize-fr30 $i > /dev/null) ; then
292 if [ -n "${verbose}" ] ; then
293 echo Removing traces of \"fr30\" from $i...
296 sed '/start\-sanitize\-fr30/,/end-\sanitize\-fr30/d' < $i > new
297 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
298 if [ -n "${verbose}" ] ; then
299 echo Caching $i in .Recover...
308 sky_files="ChangeLog configure.in configure"
309 if ( echo $* | grep keep\-sky > /dev/null ) ; then
310 for i in $sky_files ; do
311 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
312 if [ -n "${verbose}" ] ; then
313 echo Keeping sky stuff in $i
318 for i in $sky_files ; do
319 if test ! -d $i && (grep sanitize-sky $i > /dev/null) ; then
320 if [ -n "${verbose}" ] ; then
321 echo Removing traces of \"sky\" from $i...
324 sed '/start\-sanitize\-sky/,/end-\sanitize\-sky/d' < $i > new
325 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
326 if [ -n "${verbose}" ] ; then
327 echo Caching $i in .Recover...
336 vr4320_files="ChangeLog"
337 if ( echo $* | grep keep\-vr4320 > /dev/null ) ; then
338 for i in $vr4320_files ; do
339 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
340 if [ -n "${verbose}" ] ; then
341 echo Keeping vr4320 stuff in $i
346 for i in $vr4320_files ; do
347 if test ! -d $i && (grep sanitize-vr4320 $i > /dev/null) ; then
348 if [ -n "${verbose}" ] ; then
349 echo Removing traces of \"vr4320\" from $i...
352 sed '/start\-sanitize\-vr4320/,/end-\sanitize\-vr4320/d' < $i > new
353 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
354 if [ -n "${verbose}" ] ; then
355 echo Caching $i in .Recover...
364 branchbug4011_files="ChangeLog"
365 if ( echo $* | grep keep\-branchbug4011 > /dev/null ) ; then
366 for i in $branchbug4011_files ; do
367 if test ! -d $i && (grep sanitize-branchbug4011 $i > /dev/null) ; then
368 if [ -n "${verbose}" ] ; then
369 echo Keeping branchbug4011 stuff in $i
374 for i in $branchbug4011_files ; do
375 if test -r $i && (grep sanitize-branchbug4011 $i > /dev/null) ; then
376 if [ -n "${verbose}" ] ; then
377 echo Removing traces of \"branchbug4011\" from $i...
380 sed '/start\-sanitize\-branchbug4011/,/end\-sanitize\-branchbug4011/d' < $i > new
381 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
382 if [ -n "${verbose}" ] ; then
383 echo Caching $i in .Recover...
392 vr4xxx_files="ChangeLog"
393 if ( echo $* | grep keep\-vr4xxx > /dev/null ) ; then
394 for i in $vr4xxx_files ; do
395 if test ! -d $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
396 if [ -n "${verbose}" ] ; then
397 echo Keeping vr4xxx stuff in $i
402 for i in $vr4xxx_files ; do
403 if test -r $i && (grep sanitize-vr4xxx $i > /dev/null) ; then
404 if [ -n "${verbose}" ] ; then
405 echo Removing traces of \"vr4xxx\" from $i...
408 sed '/start\-sanitize\-vr4xxx/,/end\-sanitize\-vr4xxx/d' < $i > new
409 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
410 if [ -n "${verbose}" ] ; then
411 echo Caching $i in .Recover...
420 beos_files="ChangeLog configure.in configure"
421 if ( echo $* | grep keep\-beos > /dev/null ) ; then
422 for i in $beos_files ; do
423 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
424 if [ -n "${verbose}" ] ; then
425 echo Keeping beos stuff in $i
430 for i in $beos_files ; do
431 if test ! -d $i && (grep sanitize-beos $i > /dev/null) ; then
432 if [ -n "${verbose}" ] ; then
433 echo Removing traces of \"beos\" from $i...
436 sed '/start\-sanitize\-beos/,/end-\sanitize\-beos/d' < $i > new
437 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
438 if [ -n "${verbose}" ] ; then
439 echo Caching $i in .Recover...
449 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
450 echo '***' Some mentions of Sanitize are still left in gas/$i! 1>&2
454 for lost in .. $lose_these_too; do
455 if test $lost != ..; then
456 for i in Makefile.am Makefile.in configure.in configure; do
457 if fgrep $lost $i >/dev/null 2>&1; then
458 echo '***' File $lost was sanitized out but is still mentioned in gas/$i 1>&2
464 # Check each file we removed from gas/config, and make sure it is not
465 # mentioned in Makefiles or configure files.
466 for lost in .. $gas_config_files; do
467 if test $lost != .. && test $lost != CVS; then
468 if test -f config/$lost; then
471 for i in Makefile.am Makefile.in configure.in configure; do
472 if fgrep $lost $i >/dev/null 2>&1; then
473 echo '***' File gas/config/$lost was sanitized out but is still mentioned in gas/$i 1>&2
480 # This must come after all other sanitizations. Re-sanitize the .pot
482 if [ -n "${verbose}" ]; then
483 echo Re-computing files for gettext ...
486 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
487 if [ -n "${verbose}" ]; then
488 echo Caching po/POTFILES.in in .Recover...
490 mv po/POTFILES.in po/.Recover
492 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
494 if [ -n "${safe}" -a ! -f po/.Recover/gas.pot ]; then
495 if [ -n "${verbose}" ]; then
496 echo Caching po/gas.pot in .Recover...
498 mv po/gas.pot po/.Recover
500 # If this fails, Sanitization must fail.
501 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/gas.pot || exit 1