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 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
78 keep_these_too="v850-tdep.c v850ice.c ${keep_these_too}"
80 lose_these_too="v850-tdep.c v850ice.c ${lose_these_too}"
83 # All files listed between the "Things-to-keep:" line and the
84 # "Files-to-sed:" line will be kept. All other files will be removed.
85 # Directories listed in this section will have their own Sanitize
86 # called. Directories not listed will be removed in their entirety
431 # Things which are explicitly *not* kept, for now.
440 # Don't try to clean directories here, as the 'mv' command will fail.
441 # Also, grep fails on NFS mounted directories.
442 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
443 echo Catering to RMS by removing traces of \"gdbtk\"...
445 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
446 echo Removing traces of \"gdbtk\" out of $i...
448 sed '/start\-sanitize\-gdbtk/,/end-\sanitize\-gdbtk/d' < $i > new
449 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
450 echo Caching $i in .Recover...
457 echo Leaving \"gdbtk\" in the sources...
459 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
460 echo Keeping \"gdbtk\" stuff in $i, but editing out sanitize lines...
462 sed -e '/start\-sanitize\-gdbtk/d' -e '/end\-sanitize\-gdbtk/d' < $i > new
463 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
464 echo Caching $i in .Recover...
472 if ( echo $* | grep keep\-gm > /dev/null ) ; then
474 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
475 if [ -n "${verbose}" ] ; then
476 echo Keeping gm stuff in $i
482 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
483 if [ -n "${verbose}" ] ; then
484 echo Removing traces of \"gm\" from $i...
487 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
488 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
489 if [ -n "${verbose}" ] ; then
490 echo Caching $i in .Recover...
499 if ( echo $* | grep keep\-v850eq > /dev/null ) ; then
501 if test ! -d $i && (grep sanitize-v850eq $i > /dev/null) ; then
502 if [ -n "${verbose}" ] ; then
503 echo Keeping v850eq stuff in $i
509 if test ! -d $i && (grep sanitize-v850eq $i > /dev/null) ; then
510 if [ -n "${verbose}" ] ; then
511 echo Removing traces of \"v850eq\" from $i...
514 sed '/start\-sanitize\-v850eq/,/end-\sanitize\-v850eq/d' < $i > new
515 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
516 if [ -n "${verbose}" ] ; then
517 echo Caching $i in .Recover...
526 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
528 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
529 if [ -n "${verbose}" ] ; then
530 echo Keeping v850e stuff in $i
536 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
537 if [ -n "${verbose}" ] ; then
538 echo Removing traces of \"v850e\" from $i...
541 sed '/start\-sanitize\-v850e/,/end-\sanitize\-v850e/d' < $i > new
542 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
543 if [ -n "${verbose}" ] ; then
544 echo Caching $i in .Recover...
553 if ( echo $* | grep keep\-sh4 > /dev/null ) ; then
555 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
556 if [ -n "${verbose}" ] ; then
557 echo Keeping sh4 stuff in $i
563 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
564 if [ -n "${verbose}" ] ; then
565 echo Removing traces of \"sh4\" from $i...
568 sed '/start\-sanitize\-sh4/,/end-\sanitize\-sh4/d' < $i > new
569 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
570 if [ -n "${verbose}" ] ; then
571 echo Caching $i in .Recover...
580 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
582 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
583 if [ -n "${verbose}" ] ; then
584 echo Keeping r5900 stuff in $i
590 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
591 if [ -n "${verbose}" ] ; then
592 echo Removing traces of \"r5900\" from $i...
595 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
596 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
597 if [ -n "${verbose}" ] ; then
598 echo Caching $i in .Recover...
607 if ( echo $* | grep keep\-tx19 > /dev/null ) ; then
609 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
610 if [ -n "${verbose}" ] ; then
611 echo Keeping tx19 stuff in $i
617 if test ! -d $i && (grep sanitize-tx19 $i > /dev/null) ; then
618 if [ -n "${verbose}" ] ; then
619 echo Removing traces of \"tx19\" from $i...
622 sed '/start\-sanitize\-tx19/,/end-\sanitize\-tx19/d' < $i > new
623 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
624 if [ -n "${verbose}" ] ; then
625 echo Caching $i in .Recover...
634 if ( echo $* | grep keep\-tx39 > /dev/null ) ; then
636 if test ! -d $i && (grep sanitize-tx39 $i > /dev/null) ; then
637 if [ -n "${verbose}" ] ; then
638 echo Keeping tx39 stuff in $i
644 if test ! -d $i && (grep sanitize-tx39 $i > /dev/null) ; then
645 if [ -n "${verbose}" ] ; then
646 echo Removing traces of \"tx39\" from $i...
649 sed '/start\-sanitize\-tx39/,/end-\sanitize\-tx39/d' < $i > new
650 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
651 if [ -n "${verbose}" ] ; then
652 echo Caching $i in .Recover...
661 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
663 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
664 if [ -n "${verbose}" ] ; then
665 echo Keeping tic80 stuff in $i
671 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
672 if [ -n "${verbose}" ] ; then
673 echo Removing traces of \"tic80\" from $i...
676 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
677 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
678 if [ -n "${verbose}" ] ; then
679 echo Caching $i in .Recover...
689 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
690 echo '***' Some mentions of Sanitize are still left in $i! 1>&2