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 arc_files="arc-tdep.c remote-arc.c"
20 if ( echo $* | grep keep\-arc > /dev/null ) ; then
21 keep_these_too="${arc_files} ${keep_these_too}"
22 if [ -n "${verbose}" ] ; then
23 echo Keeping ${arc_files}
26 lose_these_too="${arc_files} ${lose_these_too}"
27 if [ -n "${verbose}" ] ; then
28 echo Deleting ${arc_files}
32 gdbtk_files="README.GDBTK gdbtk.c gdbtcl gdbtk.tcl"
34 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
35 lose_these_too="${gdbtk_files} ${lose_these_too}"
36 if [ -n "${verbose}" ] ; then
37 echo Deleting ${gdbtk_files}
40 keep_these_too="${gdbtk_files} ${keep_these_too}"
41 if [ -n "${verbose}" ] ; then
42 echo Keeping ${gdbtk_files}
46 # WinGDB files are not really ready to be part of FSF releases, but
47 # keep them for progressives and such.
51 if ( echo $* | grep lose\-mswin > /dev/null ) ; then
52 lose_these_too="${mswin_files} ${lose_these_too}"
53 if [ -n "${verbose}" ] ; then
54 echo Deleting ${mswin_files}
57 keep_these_too="${mswin_files} ${keep_these_too}"
58 if [ -n "${verbose}" ] ; then
59 echo Keeping ${mswin_files}
63 gm_files="gmagic.c gmagic.h"
65 if ( echo $* | grep keep\-gm > /dev/null ) ; then
66 keep_these_too="${gm_files} ${keep_these_too}"
67 if [ -n "${verbose}" ] ; then
68 echo Keeping ${gm_files}
71 lose_these_too="${gm_files} ${lose_these_too}"
72 if [ -n "${verbose}" ] ; then
73 echo Deleting ${gm_files}
77 tic80_files="tic80-tdep.c"
79 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
80 keep_these_too="${tic80_files} ${keep_these_too}"
81 if [ -n "${verbose}" ] ; then
82 echo Keeping ${tic80_files}
85 lose_these_too="${tic80_files} ${lose_these_too}"
86 if [ -n "${verbose}" ] ; then
87 echo Deleting ${tic80_files}
91 v850_files="v850ice.c v850-tdep.c"
93 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
94 keep_these_too="${v850_files} ${keep_these_too}"
95 if [ -n "${verbose}" ] ; then
96 echo Keeping ${v850_files}
99 lose_these_too="${v850_files} ${lose_these_too}"
100 if [ -n "${verbose}" ] ; then
101 echo Deleting ${v850_files}
105 # All files listed between the "Things-to-keep:" line and the
106 # "Files-to-sed:" line will be kept. All other files will be removed.
107 # Directories listed in this section will have their own Sanitize
108 # called. Directories not listed will be removed in their entirety
450 # Things which are explicitly *not* kept, for now.
459 # Don't try to clean directories here, as the 'mv' command will fail.
460 # Also, grep fails on NFS mounted directories.
461 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
462 echo Catering to RMS by removing traces of \"gdbtk\"...
464 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
465 echo Removing traces of \"gdbtk\" out of $i...
467 sed '/start\-sanitize\-gdbtk/,/end-\sanitize\-gdbtk/d' < $i > new
468 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
469 echo Caching $i in .Recover...
476 echo Leaving \"gdbtk\" in the sources...
478 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
479 echo Keeping \"gdbtk\" stuff in $i, but editing out sanitize lines...
481 sed -e '/start\-sanitize\-gdbtk/d' -e '/end\-sanitize\-gdbtk/d' < $i > new
482 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
483 echo Caching $i in .Recover...
491 arc_files="configure.tgt ChangeLog-95"
493 if ( echo $* | grep keep\-arc > /dev/null ) ; then
494 for i in $arc_files ; do
495 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
496 if [ -n "${verbose}" ] ; then
497 echo Keeping arc stuff in $i
502 for i in $arc_files ; do
503 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
504 if [ -n "${verbose}" ] ; then
505 echo Removing traces of \"arc\" from $i...
508 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
509 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
510 if [ -n "${verbose}" ] ; then
511 echo Caching $i in .Recover...
520 if ( echo $* | grep keep\-gm > /dev/null ) ; then
522 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
523 if [ -n "${verbose}" ] ; then
524 echo Keeping gm stuff in $i
530 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
531 if [ -n "${verbose}" ] ; then
532 echo Removing traces of \"gm\" from $i...
535 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
536 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
537 if [ -n "${verbose}" ] ; then
538 echo Caching $i in .Recover...
547 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
549 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
550 if [ -n "${verbose}" ] ; then
551 echo Keeping v850 stuff in $i
557 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
558 if [ -n "${verbose}" ] ; then
559 echo Removing traces of \"v850\" from $i...
562 sed '/start\-sanitize\-v850/,/end-\sanitize\-v850/d' < $i > new
563 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
564 if [ -n "${verbose}" ] ; then
565 echo Caching $i in .Recover...
574 if ( echo $* | grep keep\-sh4 > /dev/null ) ; then
576 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
577 if [ -n "${verbose}" ] ; then
578 echo Keeping sh4 stuff in $i
584 if test ! -d $i && (grep sanitize-sh4 $i > /dev/null) ; then
585 if [ -n "${verbose}" ] ; then
586 echo Removing traces of \"sh4\" from $i...
589 sed '/start\-sanitize\-sh4/,/end-\sanitize\-sh4/d' < $i > new
590 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
591 if [ -n "${verbose}" ] ; then
592 echo Caching $i in .Recover...
601 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
603 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
604 if [ -n "${verbose}" ] ; then
605 echo Keeping r5900 stuff in $i
611 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
612 if [ -n "${verbose}" ] ; then
613 echo Removing traces of \"r5900\" from $i...
616 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
617 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
618 if [ -n "${verbose}" ] ; then
619 echo Caching $i in .Recover...
628 if ( echo $* | grep keep\-tx39 > /dev/null ) ; then
630 if test ! -d $i && (grep sanitize-tx39 $i > /dev/null) ; then
631 if [ -n "${verbose}" ] ; then
632 echo Keeping tx39 stuff in $i
638 if test ! -d $i && (grep sanitize-tx39 $i > /dev/null) ; then
639 if [ -n "${verbose}" ] ; then
640 echo Removing traces of \"tx39\" from $i...
643 sed '/start\-sanitize\-tx39/,/end-\sanitize\-tx39/d' < $i > new
644 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
645 if [ -n "${verbose}" ] ; then
646 echo Caching $i in .Recover...
655 if ( echo $* | grep keep\-tic80 > /dev/null ) ; then
657 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
658 if [ -n "${verbose}" ] ; then
659 echo Keeping tic80 stuff in $i
665 if test ! -d $i && (grep sanitize-tic80 $i > /dev/null) ; then
666 if [ -n "${verbose}" ] ; then
667 echo Removing traces of \"tic80\" from $i...
670 sed '/start\-sanitize\-tic80/,/end-\sanitize\-tic80/d' < $i > new
671 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
672 if [ -n "${verbose}" ] ; then
673 echo Caching $i in .Recover...
683 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
684 echo '***' Some mentions of Sanitize are still left in $i! 1>&2