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"
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 v850_files="v850ice.c v850-tdep.c"
79 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
80 keep_these_too="${v850_files} ${keep_these_too}"
81 if [ -n "${verbose}" ] ; then
82 echo Keeping ${v850_files}
85 lose_these_too="${v850_files} ${lose_these_too}"
86 if [ -n "${verbose}" ] ; then
87 echo Deleting ${v850_files}
91 m32r_files="m32r-tdep.c m32r-rom.c m32r-stub.c"
93 if ( echo $* | grep keep\-m32r > /dev/null ) ; then
94 keep_these_too="${m32r_files} ${keep_these_too}"
95 if [ -n "${verbose}" ] ; then
96 echo Keeping ${m32r_files}
99 lose_these_too="${m32r_files} ${lose_these_too}"
100 if [ -n "${verbose}" ] ; then
101 echo Deleting ${m32r_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
440 # Things which are explicitly *not* kept, for now.
449 # Don't try to clean directories here, as the 'mv' command will fail.
450 # Also, grep fails on NFS mounted directories.
451 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
452 echo Catering to RMS by removing traces of \"gdbtk\"...
454 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
455 echo Removing traces of \"gdbtk\" out of $i...
457 sed '/start\-sanitize\-gdbtk/,/end-\sanitize\-gdbtk/d' < $i > new
458 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
459 echo Caching $i in .Recover...
466 echo Leaving \"gdbtk\" in the sources...
468 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
469 echo Keeping \"gdbtk\" stuff in $i, but editing out sanitize lines...
471 sed -e '/start\-sanitize\-gdbtk/d' -e '/end\-sanitize\-gdbtk/d' < $i > new
472 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
473 echo Caching $i in .Recover...
481 arc_files="configure.tgt ChangeLog-95"
483 if ( echo $* | grep keep\-arc > /dev/null ) ; then
484 for i in $arc_files ; do
485 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
486 if [ -n "${verbose}" ] ; then
487 echo Keeping arc stuff in $i
492 for i in $arc_files ; do
493 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
494 if [ -n "${verbose}" ] ; then
495 echo Removing traces of \"arc\" from $i...
498 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
499 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
500 if [ -n "${verbose}" ] ; then
501 echo Caching $i in .Recover...
510 if ( echo $* | grep keep\-gm > /dev/null ) ; then
512 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
513 if [ -n "${verbose}" ] ; then
514 echo Keeping gm stuff in $i
520 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
521 if [ -n "${verbose}" ] ; then
522 echo Removing traces of \"gm\" from $i...
525 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
526 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
527 if [ -n "${verbose}" ] ; then
528 echo Caching $i in .Recover...
537 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
539 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
540 if [ -n "${verbose}" ] ; then
541 echo Keeping v850 stuff in $i
547 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
548 if [ -n "${verbose}" ] ; then
549 echo Removing traces of \"v850\" from $i...
552 sed '/start\-sanitize\-v850/,/end-\sanitize\-v850/d' < $i > new
553 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
554 if [ -n "${verbose}" ] ; then
555 echo Caching $i in .Recover...
564 if ( echo $* | grep keep\-r5900 > /dev/null ) ; then
566 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
567 if [ -n "${verbose}" ] ; then
568 echo Keeping r5900 stuff in $i
574 if test ! -d $i && (grep sanitize-r5900 $i > /dev/null) ; then
575 if [ -n "${verbose}" ] ; then
576 echo Removing traces of \"r5900\" from $i...
579 sed '/start\-sanitize\-r5900/,/end-\sanitize\-r5900/d' < $i > new
580 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
581 if [ -n "${verbose}" ] ; then
582 echo Caching $i in .Recover...
591 if ( echo $* | grep keep\-m32r > /dev/null ) ; then
593 if test ! -d $i && (grep sanitize-m32r $i > /dev/null) ; then
594 if [ -n "${verbose}" ] ; then
595 echo Keeping m32r stuff in $i
601 if test ! -d $i && (grep sanitize-m32r $i > /dev/null) ; then
602 if [ -n "${verbose}" ] ; then
603 echo Removing traces of \"m32r\" from $i...
606 sed '/start\-sanitize\-m32r/,/end-\sanitize\-m32r/d' < $i > new
607 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
608 if [ -n "${verbose}" ] ; then
609 echo Caching $i in .Recover...
619 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
620 echo '***' Some mentions of Sanitize are still left in $i! 1>&2