1 # .Sanitize for devo/gdb.
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 gdbtk_files="README.GDBTK gdbtk.c gdbtcl gdbtcl2 gdbtk.tcl"
20 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
21 lose_these_too="${gdbtk_files} ${lose_these_too}"
22 if [ -n "${verbose}" ] ; then
23 echo Deleting ${gdbtk_files}
26 keep_these_too="${gdbtk_files} ${keep_these_too}"
27 if [ -n "${verbose}" ] ; then
28 echo Keeping ${gdbtk_files}
32 # WinGDB files are not really ready to be part of FSF releases, but
33 # keep them for progressives and such.
37 if ( echo $* | grep lose\-mswin > /dev/null ) ; then
38 lose_these_too="${mswin_files} ${lose_these_too}"
39 if [ -n "${verbose}" ] ; then
40 echo Deleting ${mswin_files}
43 keep_these_too="${mswin_files} ${keep_these_too}"
44 if [ -n "${verbose}" ] ; then
45 echo Keeping ${mswin_files}
49 gm_files="gmagic.c gmagic.h"
51 if ( echo $* | grep keep\-gm > /dev/null ) ; then
52 keep_these_too="${gm_files} ${keep_these_too}"
53 if [ -n "${verbose}" ] ; then
54 echo Keeping ${gm_files}
57 lose_these_too="${gm_files} ${lose_these_too}"
58 if [ -n "${verbose}" ] ; then
59 echo Deleting ${gm_files}
63 tic80_files="tic80-tdep.c"
65 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
66 keep_these_too="${tic80_files} ${keep_these_too}"
67 if [ -n "${verbose}" ] ; then
68 echo Keeping ${tic80_files}
71 lose_these_too="${tic80_files} ${lose_these_too}"
72 if [ -n "${verbose}" ] ; then
73 echo Deleting ${tic80_files}
77 # All files listed between the "Things-to-keep:" line and the
78 # "Files-to-sed:" line will be kept. All other files will be removed.
79 # Directories listed in this section will have their own Sanitize
80 # called. Directories not listed will be removed in their entirety
427 # Things which are explicitly *not* kept, for now.
436 # Don't try to clean directories here, as the 'mv' command will fail.
437 # Also, grep fails on NFS mounted directories.
438 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
439 echo Catering to RMS by removing traces of \"gdbtk\"...
441 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
442 echo Removing traces of \"gdbtk\" out of $i...
444 sed '/start\-sanitize\-gdbtk/,/end-\sanitize\-gdbtk/d' < $i > new
445 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
446 echo Caching $i in .Recover...
453 echo Leaving \"gdbtk\" in the sources...
455 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
456 echo Keeping \"gdbtk\" stuff in $i, but editing out sanitize lines...
458 sed -e '/start\-sanitize\-gdbtk/d' -e '/end\-sanitize\-gdbtk/d' < $i > new
459 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
460 echo Caching $i in .Recover...
468 if ( echo $* | grep keep\-gm > /dev/null ) ; then
470 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
471 if [ -n "${verbose}" ] ; then
472 echo Keeping gm stuff in $i
478 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
479 if [ -n "${verbose}" ] ; then
480 echo Removing traces of \"gm\" from $i...
483 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
484 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
485 if [ -n "${verbose}" ] ; then
486 echo Caching $i in .Recover...
495 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
497 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
498 if [ -n "${verbose}" ] ; then
499 echo Keeping v850e stuff in $i
505 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
506 if [ -n "${verbose}" ] ; then
507 echo Removing traces of \"v850e\" from $i...
510 sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $i > new
511 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
512 if [ -n "${verbose}" ] ; then
513 echo Caching $i in .Recover...
522 if ( echo $* | grep keep\-sh4 > /dev/null ) ; then
524 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
525 if [ -n "${verbose}" ] ; then
526 echo Keeping sh4 stuff in $i
532 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
533 if [ -n "${verbose}" ] ; then
534 echo Removing traces of \"sh4\" from $i...
537 sed '/start\-sanitize\-sh4/,/end-\sanitize\-sh4/d' < $i > new
538 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
539 if [ -n "${verbose}" ] ; then
540 echo Caching $i in .Recover...
549 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
551 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
552 if [ -n "${verbose}" ] ; then
553 echo Keeping r5900 stuff in $i
559 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
560 if [ -n "${verbose}" ] ; then
561 echo Removing traces of \"r5900\" from $i...
564 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
565 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
566 if [ -n "${verbose}" ] ; then
567 echo Caching $i in .Recover...
576 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
578 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
579 if [ -n "${verbose}" ] ; then
580 echo Keeping tx19 stuff in $i
586 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
587 if [ -n "${verbose}" ] ; then
588 echo Removing traces of \"tx19\" from $i...
591 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
592 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
593 if [ -n "${verbose}" ] ; then
594 echo Caching $i in .Recover...
603 if ( echo $* | grep keep\-tx39 > /dev/null ) ; then
605 if test ! -d $i && (grep sanitize-tx39 $i > /dev/null) ; then
606 if [ -n "${verbose}" ] ; then
607 echo Keeping tx39 stuff in $i
613 if test ! -d $i && (grep sanitize-tx39 $i > /dev/null) ; then
614 if [ -n "${verbose}" ] ; then
615 echo Removing traces of \"tx39\" from $i...
618 sed '/start\-sanitize\-tx39/,/end-\sanitize\-tx39/d' < $i > new
619 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
620 if [ -n "${verbose}" ] ; then
621 echo Caching $i in .Recover...
630 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
632 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
633 if [ -n "${verbose}" ] ; then
634 echo Keeping tic80 stuff in $i
640 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
641 if [ -n "${verbose}" ] ; then
642 echo Removing traces of \"tic80\" from $i...
645 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
646 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
647 if [ -n "${verbose}" ] ; then
648 echo Caching $i in .Recover...
658 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
659 echo '***' Some mentions of Sanitize are still left in $i! 1>&2