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}"
34 mpw_files="mpw-README mpw-configure mpw-config.in mpw-build.in ChangeLog.mpw"
36 if ( echo $* | grep keep\-mpw > /dev/null) ; then
37 keep_these_too="${keep_these_too} ${mpw_files}"
39 lose_these_too="${lose_these_too} ${mpw_files}"
42 # This top-level directory is special. We often check out only subsets
43 # of this directory, and complaining about directories or files we didn't
44 # check out just gets obnoxious.
46 list="${keep_these_too}"
49 for file in $list ; do
50 if [ -r $file ] || [ -d $file ] ; then
51 keep_these_too="${keep_these_too} $file"
55 list="${lose_these_too}"
58 for file in $list ; do
59 if [ -r $file ] || [ -d $file ] ; then
60 lose_these_too="${lose_these_too} $file"
64 # All files listed between the "Things-to-keep:" line and the
65 # "Do-last:" line will be kept. All other files will be removed.
66 # Directories listed in this section will have their own Sanitize
67 # called. Directories not listed will be removed in their entirety
83 # These will only show up if they checked out gas-extra-stuff.
89 # The lines between the "Do-last:" line and the end of the file
90 # are executed as a /bin/sh shell script after everything else is
95 # Don't try to clean directories here, as the 'mv' command will fail.
96 # Also, grep fails on NFS mounted directories.
98 if ( echo $* | egrep verbose > /dev/null ) ; then
104 # Remove "sanitize-Sanitize" lines.
105 if [ -n "${verbose}" ] ; then
106 echo Cleaning unconditional sanitizations out of Makefile.in...
109 sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
110 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
111 mv Makefile.in .Recover
115 if [ -n "${verbose}" ] ; then
116 echo Thawing away the \"chill\"...
119 if ( echo $* | grep keep\-chill > /dev/null ) ; then
121 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
122 if [ -n "${verbose}" ] ; then
123 echo Keeping chill stuff in $i
129 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
130 if [ -n "${verbose}" ] ; then
131 echo Thawing the \"chill\" out of $i...
134 sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
135 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
136 if [ -n "${verbose}" ] ; then
137 echo Caching $i in .Recover...
146 if [ -n "${verbose}" ] ; then
147 echo Removing traces of \"mpw\"...
150 if ( echo $* | grep keep\-mpw > /dev/null ) ; then
152 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
153 if [ -n "${verbose}" ] ; then
154 echo Keeping mpw stuff in $i
160 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
161 if [ -n "${verbose}" ] ; then
162 echo Removing traces of \"mpw\" from $i...
165 sed '/start\-sanitize\-mpw/,/end-\sanitize\-mpw/d' < $i > new
166 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
167 if [ -n "${verbose}" ] ; then
168 echo Caching $i in .Recover...
177 if [ -n "${verbose}" ] ; then
178 echo Processing \"arc\"...
181 arc_files="config.sub configure.in"
183 if ( echo $* | grep keep\-arc > /dev/null ) ; then
184 for i in $arc_files ; do
185 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
186 if [ -n "${verbose}" ] ; then
187 echo Keeping arc stuff in $i
193 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
194 if [ -n "${verbose}" ] ; then
195 echo Removing traces of \"arc\" from $i...
198 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
199 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
200 if [ -n "${verbose}" ] ; then
201 echo Caching $i in .Recover...
210 psion_files="config.sub configure.in"
212 if ( echo $* | grep keep\-psion > /dev/null ) ; then
213 for i in $psion_files; do
214 if test ! -d $i && (grep sanitize-psion $i > /dev/null) ; then
215 if [ -n "${verbose}" ] ; then
216 echo Keeping psion stuff in $i
222 if test ! -d $i && (grep sanitize-psion $i > /dev/null) ; then
223 if [ -n "${verbose}" ] ; then
224 echo Removing traces of \"psion\" from $i...
227 sed '/start\-sanitize\-psion/,/end-\sanitize\-psion/d' < $i > new
228 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
229 if [ -n "${verbose}" ] ; then
230 echo Caching $i in .Recover...
239 rce_files="config.sub"
241 if ( echo $* | grep keep\-rce > /dev/null ) ; then
242 for i in $rce_files ; do
243 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
244 if [ -n "${verbose}" ] ; then
245 echo Keeping rce stuff in $i
250 for i in $rce_files ; do
251 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
252 if [ -n "${verbose}" ] ; then
253 echo Removing traces of \"rce\" from $i...
256 sed '/start\-sanitize\-rce/,/end-\sanitize\-rce/d' < $i > new
257 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
258 if [ -n "${verbose}" ] ; then
259 echo Caching $i in .Recover...
269 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
270 echo '***' Some mentions of Sanitize are still left in $i! 1>&2