3cd8e7aa261747f3ccdfca5fc75538bc852dc322
[deliverable/binutils-gdb.git] / .Sanitize
1 # .Sanitize for devo.
2
3 ########################
4 # YO! READ ME!!!!!!!!!
5 # If you're about to add a file or directory which isn't checked out as part
6 # of every module in devo (e.g., if "cvs co gas+utils" won't get it, or if
7 # "cvs co gcc" won't get it), then don't, Don't, DON'T add it to the regular
8 # things-to-keep or things-to-lose sections. Instead, add it to the setting
9 # of keep_these_too or lose_these_too before those variables are rescanned
10 # to check for the existence of the items listed in them.
11 #
12 # Otherwise, somebody will check out some package that doesn't include your
13 # new file, and will get warnings from Sanitize when everything is really
14 # okay. You don't want to get people in the habit of ignoring complaints from
15 # Sanitize, do you? No, I didn't think so.
16 ########################
17
18 # Each directory to survive its way into a release will need a file
19 # like this one called "./.Sanitize". All keyword lines must exist,
20 # and must exist in the order specified by this file. Each directory
21 # in the tree will be processed, top down, in the following order.
22
23 # Hash started lines like this one are comments and will be deleted
24 # before anything else is done. Blank lines will also be squashed
25 # out.
26
27 # The lines between the "Do-first:" line and the "Things-to-keep:"
28 # line are executed as a /bin/sh shell script before anything else is
29 # done in this directory.
30
31 Do-first:
32
33 keep_these_too="${keep_these_too} .cvsignore CYGNUS autoconf
34 bfd binutils byacc cvs deja-gnu dejagnu diff dosrel dvips emacs emacs19
35 examples expect fileutils flex gas gcc gdb gdbm gdbtest glob gprof grep
36 groff include install.sh ispell ld libg++ libgcc libgloss libiberty
37 libio librx libstdc++ m4 make mmalloc move-if-change newlib opcodes
38 pagas patch prms rcs readline sed send-pr shellutils sim tcl textutils
39 tk texinfo tgas utils uudecode wdiff xiberty
40 configure.bat makeall.bat
41 mpw-README mpw-configure mpw-config.in mpw-build.in"
42
43 lose_these_too="${lose_these_too} testsuite"
44
45 cygnus_files="release release-info build-all.mk test-build.mk COPYING.NEWLIB"
46
47 if ( echo $* | grep keep\-cygnus > /dev/null) ; then
48 keep_these_too="${keep_these_too} ${cygnus_files}"
49 else
50 lose_these_too="${lose_these_too} ${cygnus_files}"
51 fi
52
53 gdbtk_files="tcl tk"
54
55 if ( echo $* | grep lose\-gdbtk > /dev/null) ; then
56 lose_these_too="${lose_these_too} ${gdbtk_files}"
57 if [ -n "${verbose}" ] ; then
58 echo Deleting ${gdbtk_files}
59 fi
60 else
61 keep_these_too="${keep_these_too} ${gdbtk_files}"
62 if [ -n "${verbose}" ] ; then
63 echo Keeping ${gdbtk_files}
64 fi
65 fi
66
67 # This is for newlib net releases.
68 newlib_files="COPYING.NEWLIB"
69
70 if ( echo $* | grep keep\-newlib > /dev/null) ; then
71 keep_these_too="${keep_these_too} ${newlib_files}"
72 else
73 lose_these_too="${lose_these_too} ${newlib_files}"
74 fi
75
76 # This top-level directory is special. We often check out only subsets
77 # of this directory, and complaining about directories or files we didn't
78 # check out just gets obnoxious.
79
80 list="`(for i in ${keep_these_too}; do echo $i ; done) | sort -u`"
81 keep_these_too=
82
83 for file in $list ; do
84 if [ -r $file ] || [ -d $file ] ; then
85 keep_these_too="${keep_these_too} $file"
86 fi
87 done
88
89 list="`(for i in ${lose_these_too}; do echo $i ; done) | sort -u` "
90 lose_these_too=
91
92 for file in $list ; do
93 if [ -r $file ] || [ -d $file ] ; then
94 lose_these_too="${lose_these_too} $file"
95 fi
96 done
97
98 # All files listed between the "Things-to-keep:" line and the
99 # "Do-last:" line will be kept. All other files will be removed.
100 # Directories listed in this section will have their own Sanitize
101 # called. Directories not listed will be removed in their entirety
102 # with rm -rf.
103
104 Things-to-keep:
105
106 COPYING
107 COPYING.LIB
108 ChangeLog
109 Makefile.in
110 README
111 config
112 config.guess
113 config.sub
114 configure
115 configure.in
116 etc
117
118 Things-to-lose:
119
120 # The lines between the "Do-last:" line and the end of the file
121 # are executed as a /bin/sh shell script after everything else is
122 # done.
123
124 Do-last:
125
126 # Don't try to clean directories here, as the 'mv' command will fail.
127 # Also, grep fails on NFS mounted directories.
128
129 if ( echo $* | egrep verbose > /dev/null ) ; then
130 verbose=true
131 else
132 verbose=
133 fi
134
135 # Remove "sanitize-Sanitize" lines.
136 if [ -n "${verbose}" ] ; then
137 echo Cleaning unconditional sanitizations out of Makefile.in...
138 fi
139 cp Makefile.in new
140 sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
141 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
142 mv Makefile.in .Recover
143 fi
144 mv new Makefile.in
145
146 if [ -n "${verbose}" ] ; then
147 echo Thawing away the \"chill\"...
148 fi
149
150 if ( echo $* | grep keep\-chill > /dev/null ) ; then
151 for i in * ; do
152 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
153 if [ -n "${verbose}" ] ; then
154 echo Keeping chill stuff in $i
155 fi
156 fi
157 done
158 else
159 for i in * ; do
160 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
161 if [ -n "${verbose}" ] ; then
162 echo Thawing the \"chill\" out of $i...
163 fi
164 cp $i new
165 sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
166 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
167 if [ -n "${verbose}" ] ; then
168 echo Caching $i in .Recover...
169 fi
170 mv $i .Recover
171 fi
172 mv new $i
173 fi
174 done
175 fi
176
177 if [ -n "${verbose}" ] ; then
178 echo Processing \"arc\"...
179 fi
180
181 arc_files="config.sub configure.in"
182
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
188 fi
189 fi
190 done
191 else
192 for i in * ; do
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...
196 fi
197 cp $i new
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...
202 fi
203 mv $i .Recover
204 fi
205 mv new $i
206 fi
207 done
208 fi
209
210 psion_files="config.sub configure.in"
211
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
217 fi
218 fi
219 done
220 else
221 for i in * ; do
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...
225 fi
226 cp $i new
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...
231 fi
232 mv $i .Recover
233 fi
234 mv new $i
235 fi
236 done
237 fi
238
239 rce_files="config.sub"
240
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
246 fi
247 fi
248 done
249 else
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...
254 fi
255 cp $i new
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...
260 fi
261 mv $i .Recover
262 fi
263 mv new $i
264 fi
265 done
266 fi
267
268 for i in * ; do
269 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
270 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
271 fi
272 done
273
274 # eof
This page took 0.034281 seconds and 4 git commands to generate.