use changequote around []
[deliverable/binutils-gdb.git] / .Sanitize
CommitLineData
43e36dd2 1# .Sanitize for devo.
a93b3c77 2
5db7ecb7 3# Each directory to survive its way into a release will need a file
a93b3c77
RP
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
43e36dd2 14# done in this directory.
a93b3c77
RP
15
16Do-first:
17
1ed0529e 18keep_these_too="${keep_these_too} .cvsignore CYGNUS autoconf
e03b0bca
KR
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
f38cb096
JM
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"
e03b0bca 25
1ed0529e 26cygnus_files="release release-info build-all.mk COPYING.NEWLIB"
96c805d8 27
7d0eab7b 28if ( echo $* | grep keep\-cygnus > /dev/null) ; then
96c805d8 29 keep_these_too="${keep_these_too} ${cygnus_files}"
80cad9cc 30else
96c805d8 31 lose_these_too="${lose_these_too} ${cygnus_files}"
7d0eab7b
DZ
32fi
33
fc5a05e9
SS
34gdbtk_files="tcl tk"
35
36if ( 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
41else
42 keep_these_too="${keep_these_too} ${gdbtk_files}"
43 if [ -n "${verbose}" ] ; then
44 echo Keeping ${gdbtk_files}
45 fi
5db7ecb7 46fi
7d0eab7b 47
e03b0bca
KR
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
52list="${keep_these_too}"
53keep_these_too=
54
55for file in $list ; do
56 if [ -r $file ] || [ -d $file ] ; then
57 keep_these_too="${keep_these_too} $file"
58 fi
59done
60
61list="${lose_these_too}"
62lose_these_too=
63
64for file in $list ; do
65 if [ -r $file ] || [ -d $file ] ; then
66 lose_these_too="${lose_these_too} $file"
67 fi
68done
69
a93b3c77 70# All files listed between the "Things-to-keep:" line and the
43e36dd2 71# "Do-last:" line will be kept. All other files will be removed.
a93b3c77
RP
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
76Things-to-keep:
77
6e37b215
PB
78COPYING
79COPYING.LIB
57d32184 80ChangeLog
a93b3c77 81Makefile.in
965a9f14 82README
a93b3c77 83config
5cc24596 84config.guess
db2de419 85config.sub
a93b3c77
RP
86configure
87configure.in
701df845 88etc
3be6e47e 89# These will only show up if they checked out gas-extra-stuff.
16004cc8
KR
90configure.bat
91makeall.bat
7f390875
SS
92mpw-README
93mpw-configure
94mpw-config.in
95mpw-build.in
a93b3c77 96
87756e15
RP
97Things-to-lose:
98
43e36dd2
RP
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
a93b3c77
RP
103Do-last:
104
bf150019
DE
105# Don't try to clean directories here, as the 'mv' command will fail.
106# Also, grep fails on NFS mounted directories.
107
7b85349f
RP
108if ( echo $* | egrep verbose > /dev/null ) ; then
109 verbose=true
110else
111 verbose=
112fi
113
eecef7ef
FF
114# Remove "sanitize-Sanitize" lines.
115if [ -n "${verbose}" ] ; then
116 echo Cleaning unconditional sanitizations out of Makefile.in...
117fi
118cp Makefile.in new
119sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
120if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
121 mv Makefile.in .Recover
122fi
123mv new Makefile.in
124
7b85349f
RP
125if [ -n "${verbose}" ] ; then
126 echo Thawing away the \"chill\"...
127fi
5d4ec851 128
5d4ec851
FF
129if ( echo $* | grep keep\-chill > /dev/null ) ; then
130 for i in * ; do
131 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
7b85349f
RP
132 if [ -n "${verbose}" ] ; then
133 echo Keeping chill stuff in $i
134 fi
5d4ec851
FF
135 fi
136 done
137else
138 for i in * ; do
139 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
7b85349f
RP
140 if [ -n "${verbose}" ] ; then
141 echo Thawing the \"chill\" out of $i...
142 fi
5d4ec851
FF
143 cp $i new
144 sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
145 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
7b85349f
RP
146 if [ -n "${verbose}" ] ; then
147 echo Caching $i in .Recover...
148 fi
5d4ec851
FF
149 mv $i .Recover
150 fi
151 mv new $i
152 fi
153 done
5d4ec851
FF
154fi
155
86118528
KR
156if [ -n "${verbose}" ] ; then
157 echo Processing \"arc\"...
158fi
159
bf150019
DE
160arc_files="config.sub configure.in"
161
86118528 162if ( echo $* | grep keep\-arc > /dev/null ) ; then
bf150019 163 for i in $arc_files ; do
86118528
KR
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
170else
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
bf150019
DE
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
187fi
188
189psion_files="config.sub configure.in"
190
191if ( 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
199else
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
86118528
KR
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
216fi
217
03c4ce2f 218rce_files="config.sub"
5c680afd 219
03c4ce2f
MT
220if ( 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
5c680afd 223 if [ -n "${verbose}" ] ; then
03c4ce2f 224 echo Keeping rce stuff in $i
5c680afd
MT
225 fi
226 fi
227 done
228else
03c4ce2f
MT
229 for i in $rce_files ; do
230 if test ! -d $i && (grep sanitize-rce $i > /dev/null) ; then
5c680afd 231 if [ -n "${verbose}" ] ; then
03c4ce2f 232 echo Removing traces of \"rce\" from $i...
5c680afd
MT
233 fi
234 cp $i new
03c4ce2f 235 sed '/start\-sanitize\-rce/,/end-\sanitize\-rce/d' < $i > new
5c680afd
MT
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
245fi
246
e11b54be
PB
247for i in * ; do
248 if test ! -d $i && (grep sanitize $i > /dev/null) ; then
7b85349f 249 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
e11b54be
PB
250 fi
251done
57d32184
RP
252
253# eof
This page took 0.130448 seconds and 4 git commands to generate.