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 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="magic.c magic.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 # 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
377 # Things which are explicitly *not* kept, for now.
386 # Don't try to clean directories here, as the 'mv' command will fail.
387 # Also, grep fails on NFS mounted directories.
388 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
389 echo Catering to RMS by removing traces of \"gdbtk\"...
391 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
392 echo Removing traces of \"gdbtk\" out of $i...
394 sed '/start\-sanitize\-gdbtk/,/end-\sanitize\-gdbtk/d' < $i > new
395 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
396 echo Caching $i in .Recover...
403 echo Leaving \"gdbtk\" in the sources...
405 if test ! -d $i && (grep sanitize-gdbtk $i > /dev/null) ; then
406 echo Keeping \"gdbtk\" stuff in $i, but editing out sanitize lines...
408 sed -e '/start\-sanitize\-gdbtk/d' -e '/end\-sanitize\-gdbtk/d' < $i > new
409 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
410 echo Caching $i in .Recover...
418 r16_files="configure.in configure"
420 if ( echo $* | grep keep\-r16 > /dev/null ) ; then
421 for i in $r16_files ; do
422 if test ! -d $i && (grep sanitize-r16 $i > /dev/null) ; then
423 if [ -n "${verbose}" ] ; then
424 echo Keeping r16 stuff in $i
429 for i in $r16_files ; do
430 if test ! -d $i && (grep sanitize-r16 $i > /dev/null) ; then
431 if [ -n "${verbose}" ] ; then
432 echo Removing traces of \"r16\" from $i...
435 sed '/start\-sanitize\-r16/,/end-\sanitize\-r16/d' < $i > new
436 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
437 if [ -n "${verbose}" ] ; then
438 echo Caching $i in .Recover...
447 arc_files="configure.in configure ChangeLog"
449 if ( echo $* | grep keep\-arc > /dev/null ) ; then
450 for i in $arc_files ; do
451 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
452 if [ -n "${verbose}" ] ; then
453 echo Keeping arc stuff in $i
458 for i in $arc_files ; do
459 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
460 if [ -n "${verbose}" ] ; then
461 echo Removing traces of \"arc\" from $i...
464 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
465 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
466 if [ -n "${verbose}" ] ; then
467 echo Caching $i in .Recover...
476 sh3e_files="ChangeLog"
478 if ( echo $* | grep keep\-sh3e > /dev/null ) ; then
479 for i in $sh3e_files ; do
480 if test ! -d $i && (grep sanitize-sh3e $i > /dev/null) ; then
481 if [ -n "${verbose}" ] ; then
482 echo Keeping sh3e stuff in $i
487 for i in $sh3e_files ; do
488 if test ! -d $i && (grep sanitize-sh3e $i > /dev/null) ; then
489 if [ -n "${verbose}" ] ; then
490 echo Removing traces of \"sh3e\" from $i...
493 sed '/start\-sanitize\-sh3e/,/end-\sanitize\-sh3e/d' < $i > new
494 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
495 if [ -n "${verbose}" ] ; then
496 echo Caching $i in .Recover...
505 if ( echo $* | grep keep\-gm > /dev/null ) ; then
507 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
508 if [ -n "${verbose}" ] ; then
509 echo Keeping gm stuff in $i
515 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
516 if [ -n "${verbose}" ] ; then
517 echo Removing traces of \"gm\" from $i...
520 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
521 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
522 if [ -n "${verbose}" ] ; then
523 echo Caching $i in .Recover...
533 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
534 echo '***' Some mentions of Sanitize are still left in $i! 1>&2