Fix for PR6697:
[deliverable/binutils-gdb.git] / .Sanitize
1 # .Sanitize for devo.
2
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.
7
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
10 # out.
11
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.
15
16 Do-first:
17
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"
25
26 cygnus_files="release release-info build-all.mk COPYING.NEWLIB"
27
28 if ( echo $* | grep keep\-cygnus > /dev/null) ; then
29 keep_these_too="${keep_these_too} ${cygnus_files}"
30 else
31 lose_these_too="${lose_these_too} ${cygnus_files}"
32 fi
33
34 gdbtk_files="tcl tk"
35
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}
40 fi
41 else
42 keep_these_too="${keep_these_too} ${gdbtk_files}"
43 if [ -n "${verbose}" ] ; then
44 echo Keeping ${gdbtk_files}
45 fi
46 fi
47
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.
51
52 list="${keep_these_too}"
53 keep_these_too=
54
55 for file in $list ; do
56 if [ -r $file ] || [ -d $file ] ; then
57 keep_these_too="${keep_these_too} $file"
58 fi
59 done
60
61 list="${lose_these_too}"
62 lose_these_too=
63
64 for file in $list ; do
65 if [ -r $file ] || [ -d $file ] ; then
66 lose_these_too="${lose_these_too} $file"
67 fi
68 done
69
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
74 # with rm -rf.
75
76 Things-to-keep:
77
78 COPYING
79 COPYING.LIB
80 ChangeLog
81 Makefile.in
82 README
83 config
84 config.guess
85 config.sub
86 configure
87 configure.in
88 etc
89 # These will only show up if they checked out gas-extra-stuff.
90 configure.bat
91 makeall.bat
92 mpw-README
93 mpw-configure
94 mpw-config.in
95 mpw-build.in
96
97 Things-to-lose:
98
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
101 # done.
102
103 Do-last:
104
105 # Don't try to clean directories here, as the 'mv' command will fail.
106 # Also, grep fails on NFS mounted directories.
107
108 if ( echo $* | egrep verbose > /dev/null ) ; then
109 verbose=true
110 else
111 verbose=
112 fi
113
114 # Remove "sanitize-Sanitize" lines.
115 if [ -n "${verbose}" ] ; then
116 echo Cleaning unconditional sanitizations out of Makefile.in...
117 fi
118 cp Makefile.in new
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
122 fi
123 mv new Makefile.in
124
125 if [ -n "${verbose}" ] ; then
126 echo Thawing away the \"chill\"...
127 fi
128
129 if ( echo $* | grep keep\-chill > /dev/null ) ; then
130 for i in * ; do
131 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
132 if [ -n "${verbose}" ] ; then
133 echo Keeping chill stuff in $i
134 fi
135 fi
136 done
137 else
138 for i in * ; do
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...
142 fi
143 cp $i new
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...
148 fi
149 mv $i .Recover
150 fi
151 mv new $i
152 fi
153 done
154 fi
155
156 if [ -n "${verbose}" ] ; then
157 echo Processing \"arc\"...
158 fi
159
160 arc_files="config.sub configure.in"
161
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
167 fi
168 fi
169 done
170 else
171 for i in * ; do
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...
175 fi
176 cp $i new
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...
181 fi
182 mv $i .Recover
183 fi
184 mv new $i
185 fi
186 done
187 fi
188
189 psion_files="config.sub configure.in"
190
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
196 fi
197 fi
198 done
199 else
200 for i in * ; do
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...
204 fi
205 cp $i new
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...
210 fi
211 mv $i .Recover
212 fi
213 mv new $i
214 fi
215 done
216 fi
217
218 rce_files="config.sub"
219
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
225 fi
226 fi
227 done
228 else
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...
233 fi
234 cp $i new
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...
239 fi
240 mv $i .Recover
241 fi
242 mv new $i
243 fi
244 done
245 fi
246
247 for i in * ; do
248 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
249 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
250 fi
251 done
252
253 # eof
This page took 0.058688 seconds and 4 git commands to generate.