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 keep_these_too="${keep_these_too} .cvsignore CYGNUS autoconf
19 bfd binutils byacc cvs deja-gnu dejagnu diff dosrel dvips emacs emacs19
20 examples expect fileutils flex gas gcc gdb gdbm gdbtest glob gprof grep
21 groff include install.sh ispell ld libg++ libgcc libgloss libiberty
22 libio librx libstdc++ m4 make mmalloc move-if-change newlib opcodes
23 pagas patch prms rcs readline sed send-pr shellutils sim tcl textutils
24 tk test-build.mk texinfo tgas utils uudecode wdiff xiberty"
26 cygnus_files="release release-info build-all.mk COPYING.NEWLIB"
28 if ( echo $* | grep keep\-cygnus > /dev/null) ; then
29 keep_these_too="${keep_these_too} ${cygnus_files}"
31 lose_these_too="${lose_these_too} ${cygnus_files}"
36 if ( echo $* | grep lose\-gdbtk > /dev/null) ; then
37 lose_these_too="${lose_these_too} ${gdbtk_files}"
38 if [ -n "${verbose}" ] ; then
39 echo Deleting ${gdbtk_files}
42 keep_these_too="${keep_these_too} ${gdbtk_files}"
43 if [ -n "${verbose}" ] ; then
44 echo Keeping ${gdbtk_files}
48 # This top-level directory is special. We often check out only subsets
49 # of this directory, and complaining about directories or files we didn't
50 # check out just gets obnoxious.
52 list="${keep_these_too}"
55 for file in $list ; do
56 if [ -r $file ] || [ -d $file ] ; then
57 keep_these_too="${keep_these_too} $file"
61 list="${lose_these_too}"
64 for file in $list ; do
65 if [ -r $file ] || [ -d $file ] ; then
66 lose_these_too="${lose_these_too} $file"
70 # All files listed between the "Things-to-keep:" line and the
71 # "Do-last:" line will be kept. All other files will be removed.
72 # Directories listed in this section will have their own Sanitize
73 # called. Directories not listed will be removed in their entirety
89 # These will only show up if they checked out gas-extra-stuff.
99 # The lines between the "Do-last:" line and the end of the file
100 # are executed as a /bin/sh shell script after everything else is
105 # Don't try to clean directories here, as the 'mv' command will fail.
106 # Also, grep fails on NFS mounted directories.
108 if ( echo $* | egrep verbose > /dev/null ) ; then
114 # Remove "sanitize-Sanitize" lines.
115 if [ -n "${verbose}" ] ; then
116 echo Cleaning unconditional sanitizations out of Makefile.in...
119 sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
120 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
121 mv Makefile.in .Recover
125 if [ -n "${verbose}" ] ; then
126 echo Thawing away the \"chill\"...
129 if ( echo $* | grep keep\-chill > /dev/null ) ; then
131 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
132 if [ -n "${verbose}" ] ; then
133 echo Keeping chill stuff in $i
139 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
140 if [ -n "${verbose}" ] ; then
141 echo Thawing the \"chill\" out of $i...
144 sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
145 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
146 if [ -n "${verbose}" ] ; then
147 echo Caching $i in .Recover...
156 if [ -n "${verbose}" ] ; then
157 echo Processing \"arc\"...
160 arc_files="config.sub configure.in"
162 if ( echo $* | grep keep\-arc > /dev/null ) ; then
163 for i in $arc_files ; do
164 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
165 if [ -n "${verbose}" ] ; then
166 echo Keeping arc stuff in $i
172 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
173 if [ -n "${verbose}" ] ; then
174 echo Removing traces of \"arc\" from $i...
177 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
178 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
179 if [ -n "${verbose}" ] ; then
180 echo Caching $i in .Recover...
189 psion_files="config.sub configure.in"
191 if ( echo $* | grep keep\-psion > /dev/null ) ; then
192 for i in $psion_files; do
193 if test ! -d $i && (grep sanitize-psion $i > /dev/null) ; then
194 if [ -n "${verbose}" ] ; then
195 echo Keeping psion stuff in $i
201 if test ! -d $i && (grep sanitize-psion $i > /dev/null) ; then
202 if [ -n "${verbose}" ] ; then
203 echo Removing traces of \"psion\" from $i...
206 sed '/start\-sanitize\-psion/,/end-\sanitize\-psion/d' < $i > new
207 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
208 if [ -n "${verbose}" ] ; then
209 echo Caching $i in .Recover...
218 rce_files="config.sub"
220 if ( echo $* | grep keep\-rce > /dev/null ) ; then
221 for i in $rce_files ; do
222 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
223 if [ -n "${verbose}" ] ; then
224 echo Keeping rce stuff in $i
229 for i in $rce_files ; do
230 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
231 if [ -n "${verbose}" ] ; then
232 echo Removing traces of \"rce\" from $i...
235 sed '/start\-sanitize\-rce/,/end-\sanitize\-rce/d' < $i > new
236 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
237 if [ -n "${verbose}" ] ; then
238 echo Caching $i in .Recover...
248 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
249 echo '***' Some mentions of Sanitize are still left in $i! 1>&2