1 ########################
13 # YO! READ ME!!!!!!!!!
14 # If you're about to add a file or directory which isn't checked out as part
15 # of every module in devo (e.g., if "cvs co gas+utils" won't get it, or if
16 # "cvs co gcc" won't get it), then don't, Don't, DON'T add it to the regular
17 # things-to-keep or things-to-lose sections. Instead, add it to the setting
18 # of keep_these_too or lose_these_too before those variables are rescanned
19 # to check for the existence of the items listed in them.
21 # Otherwise, somebody will check out some package that doesn't include your
22 # new file, and will get warnings from Sanitize when everything is really
23 # okay. You don't want to get people in the habit of ignoring complaints from
24 # Sanitize, do you? No, I didn't think so.
26 # If you do add a file to the regular things-to-keep section, don't forget
27 # to add the corresponding entry to the devo-support entry (or whatever) in
30 ########################
34 # Each directory to survive its way into a release will need a file
35 # like this one called "./.Sanitize". All keyword lines must exist,
36 # and must exist in the order specified by this file. Each directory
37 # in the tree will be processed, top down, in the following order.
39 # Hash started lines like this one are comments and will be deleted
40 # before anything else is done. Blank lines will also be squashed
43 # The lines between the "Do-first:" line and the "Things-to-keep:"
44 # line are executed as a /bin/sh shell script before anything else is
45 # done in this directory.
49 keep_these_too="${keep_these_too} .cvsignore CYGNUS autoconf
50 bfd binutils byacc cvs deja-gnu dejagnu diff dosrel dvips emacs emacs19
51 examples expect fileutils flex
52 gas gcc gdb gdbm gdbtest glob gprof grep grez groff
53 include install.sh ispell
54 ld libg++ libgcc libgloss libiberty libio librx libstdc++
55 m4 make mmalloc move-if-change newlib opcodes
56 pagas patch prms rcs readline sed send-pr shellutils sim textutils
57 texinfo tgas utils uudecode wdiff xiberty
58 configure.bat makeall.bat winsup
60 mpw-README mpw-configure mpw-config.in mpw-build.in"
62 lose_these_too="${lose_these_too} testsuite"
64 cygnus_files="release release-info build-all.mk test-build.mk COPYING.NEWLIB"
66 if ( echo $* | grep keep\-cygnus > /dev/null) ; then
67 keep_these_too="${keep_these_too} ${cygnus_files}"
69 lose_these_too="${lose_these_too} ${cygnus_files}"
74 if ( echo $* | grep lose\-gdbtk > /dev/null) ; then
75 lose_these_too="${lose_these_too} ${gdbtk_files}"
76 if [ -n "${verbose}" ] ; then
77 echo Deleting ${gdbtk_files}
80 keep_these_too="${keep_these_too} ${gdbtk_files}"
81 if [ -n "${verbose}" ] ; then
82 echo Keeping ${gdbtk_files}
86 # This is for newlib net releases.
87 newlib_file="COPYING.NEWLIB"
89 if (echo $* | grep keep\-newlib > /dev/null) ; then
90 if (echo $* | grep -v keep\-cygnus > /dev/null) ; then
91 keep_these_too="${keep_these_too} ${newlib_file}"
92 lose_these_too="`echo ${lose_these_too} | sed -e s/${newlib_file}//`"
95 true; # Let keep-cygnus handle it.
98 # This top-level directory is special. We often check out only subsets
99 # of this directory, and complaining about directories or files we didn't
100 # check out just gets obnoxious.
102 list="`(for i in ${keep_these_too}; do echo $i ; done) | sort -u`"
105 for file in $list ; do
106 if [ -r $file ] || [ -d $file ] ; then
107 keep_these_too="${keep_these_too} $file"
111 list="`(for i in ${lose_these_too}; do echo $i ; done) | sort -u` "
114 for file in $list ; do
115 if [ -r $file ] || [ -d $file ] ; then
116 lose_these_too="${lose_these_too} $file"
120 # All files listed between the "Things-to-keep:" line and the
121 # "Do-last:" line will be kept. All other files will be removed.
122 # Directories listed in this section will have their own Sanitize
123 # called. Directories not listed will be removed in their entirety
144 # The lines between the "Do-last:" line and the end of the file
145 # are executed as a /bin/sh shell script after everything else is
150 # Don't try to clean directories here, as the 'mv' command will fail.
151 # Also, grep fails on NFS mounted directories.
153 if ( echo $* | egrep verbose > /dev/null ) ; then
159 # Remove "sanitize-Sanitize" lines.
160 if [ -n "${verbose}" ] ; then
161 echo Cleaning unconditional sanitizations out of Makefile.in...
164 sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
165 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
166 mv Makefile.in .Recover
170 if [ -n "${verbose}" ] ; then
171 echo Thawing away the \"chill\"...
174 if ( echo $* | grep keep\-chill > /dev/null ) ; then
176 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
177 if [ -n "${verbose}" ] ; then
178 echo Keeping chill stuff in $i
184 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
185 if [ -n "${verbose}" ] ; then
186 echo Thawing the \"chill\" out of $i...
189 sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
190 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
191 if [ -n "${verbose}" ] ; then
192 echo Caching $i in .Recover...
201 if [ -n "${verbose}" ] ; then
202 echo Processing \"arc\"...
205 arc_files="config.sub configure.in config-ml.in"
207 if ( echo $* | grep keep\-arc > /dev/null ) ; then
208 for i in $arc_files ; do
209 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
210 if [ -n "${verbose}" ] ; then
211 echo Keeping arc stuff in $i
217 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
218 if [ -n "${verbose}" ] ; then
219 echo Removing traces of \"arc\" from $i...
222 sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
223 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
224 if [ -n "${verbose}" ] ; then
225 echo Caching $i in .Recover...
234 rce_files="config.sub"
236 if ( echo $* | grep keep\-rce > /dev/null ) ; then
237 for i in $rce_files ; do
238 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
239 if [ -n "${verbose}" ] ; then
240 echo Keeping rce stuff in $i
245 for i in $rce_files ; do
246 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
247 if [ -n "${verbose}" ] ; then
248 echo Removing traces of \"rce\" from $i...
251 sed '/start\-sanitize\-rce/,/end-\sanitize\-rce/d' < $i > new
252 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
253 if [ -n "${verbose}" ] ; then
254 echo Caching $i in .Recover...
263 if ( echo $* | grep lose\-gdbtk > /dev/null ) ; then
264 echo Catering to RMS by removing traces of \"gdbtk\"...
265 if [ -n "${verbose}" ] ; then
266 echo Removing traces of \"gdbtk\" from Makefile.in...
269 sed -e '/GDBTK_SUPPORT_DIRS=/d' -e 's/ $(GDBTK_SUPPORT_DIRS)//' < Makefile.in > new
270 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
271 if [ -n "${verbose}" ] ; then
272 echo Caching Makefile.in in .Recover...
274 mv Makefile.in .Recover
279 if ( echo $* | grep keep\-gm > /dev/null ) ; then
281 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
282 if [ -n "${verbose}" ] ; then
283 echo Keeping gm stuff in $i
289 if test ! -d $i && (grep sanitize-gm $i > /dev/null) ; then
290 if [ -n "${verbose}" ] ; then
291 echo Removing traces of \"gm\" from $i...
294 sed '/start\-sanitize\-gm/,/end-\sanitize\-gm/d' < $i > new
295 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
296 if [ -n "${verbose}" ] ; then
297 echo Caching $i in .Recover...
306 # Do this check LAST!
308 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
309 echo '***' Some mentions of Sanitize are still left in $i! 1>&2