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 d10v_files="d10v-tdep.c"
34 if ( echo $* | grep keep\-d10v > /dev/null ) ; then
35 keep_these_too="${d10v_files} ${keep_these_too}"
36 if [ -n "${verbose}" ] ; then
37 echo Keeping ${d10v_files}
40 lose_these_too="${d10v_files} ${lose_these_too}"
41 if [ -n "${verbose}" ] ; then
42 echo Deleting ${d10v_files}
46 gdbtk_files="README.GDBTK gdbtk.c gdbtk.tcl"
48 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
49 lose_these_too="${gdbtk_files} ${lose_these_too}"
50 if [ -n "${verbose}" ] ; then
51 echo Deleting ${gdbtk_files}
54 keep_these_too="${gdbtk_files} ${keep_these_too}"
55 if [ -n "${verbose}" ] ; then
56 echo Keeping ${gdbtk_files}
60 # WinGDB files are not really ready to be part of FSF releases, but
61 # keep them for progressives and such.
65 if ( echo $* | grep lose\-mswin > /dev/null ) ; then
66 lose_these_too="${mswin_files} ${lose_these_too}"
67 if [ -n "${verbose}" ] ; then
68 echo Deleting ${mswin_files}
71 keep_these_too="${mswin_files} ${keep_these_too}"
72 if [ -n "${verbose}" ] ; then
73 echo Keeping ${mswin_files}
77 gm_files="gmagic.c gmagic.h"
79 if ( echo $* | grep keep\-gm > /dev/null ) ; then
80 keep_these_too="${gm_files} ${keep_these_too}"
81 if [ -n "${verbose}" ] ; then
82 echo Keeping ${gm_files}
85 lose_these_too="${gm_files} ${lose_these_too}"
86 if [ -n "${verbose}" ] ; then
87 echo Deleting ${gm_files}
91 v850_files="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
434 # Things which are explicitly *not* kept, for now.
443 # Don't try to clean directories here, as the 'mv' command will fail.
444 # Also, grep fails on NFS mounted directories.
445 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
446 echo Catering to RMS by removing traces of \"gdbtk\"...
448 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
449 echo Removing traces of \"gdbtk\" out of $i...
451 sed '/start\-sanitize\-gdbtk/,/end-\sanitize\-gdbtk/d' < $i > new
452 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
453 echo Caching $i in .Recover...
460 echo Leaving \"gdbtk\" in the sources...
462 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
463 echo Keeping \"gdbtk\" stuff in $i, but editing out sanitize lines...
465 sed -e '/start\-sanitize\-gdbtk/d' -e '/end\-sanitize\-gdbtk/d' < $i > new
466 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
467 echo Caching $i in .Recover...
475 arc_files="configure.in configure ChangeLog-95"
477 if ( echo $* | grep keep\-arc > /dev/null ) ; then
478 for i in $arc_files ; do
479 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
480 if [ -n "${verbose}" ] ; then
481 echo Keeping arc stuff in $i
486 for i in $arc_files ; do
487 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
488 if [ -n "${verbose}" ] ; then
489 echo Removing traces of \"arc\" from $i...
492 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
493 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
494 if [ -n "${verbose}" ] ; then
495 echo Caching $i in .Recover...
504 d10v_files="configure.in configure ChangeLog"
506 if ( echo $* | grep keep\-d10v > /dev/null ) ; then
507 for i in $d10v_files ; do
508 if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then
509 if [ -n "${verbose}" ] ; then
510 echo Keeping d10v stuff in $i
515 for i in $d10v_files ; do
516 if test ! -d $i && (grep sanitize-d10v $i > /dev/null) ; then
517 if [ -n "${verbose}" ] ; then
518 echo Removing traces of \"d10v\" from $i...
521 sed '/start\-sanitize\-d10v/,/end-\sanitize\-d10v/d' < $i > new
522 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
523 if [ -n "${verbose}" ] ; then
524 echo Caching $i in .Recover...
533 if ( echo $* | grep keep\-gm > /dev/null ) ; then
535 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
536 if [ -n "${verbose}" ] ; then
537 echo Keeping gm stuff in $i
543 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
544 if [ -n "${verbose}" ] ; then
545 echo Removing traces of \"gm\" from $i...
548 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
549 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
550 if [ -n "${verbose}" ] ; then
551 echo Caching $i in .Recover...
560 if ( echo $* | grep keep\-v850 > /dev/null ) ; then
562 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
563 if [ -n "${verbose}" ] ; then
564 echo Keeping v850 stuff in $i
570 if test ! -d $i && (grep sanitize-v850 $i > /dev/null) ; then
571 if [ -n "${verbose}" ] ; then
572 echo Removing traces of \"v850\" from $i...
575 sed '/start\-sanitize\-v850/,/end-\sanitize\-v850/d' < $i > new
576 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
577 if [ -n "${verbose}" ] ; then
578 echo Caching $i in .Recover...
588 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
589 echo '***' Some mentions of Sanitize are still left in $i! 1>&2