Trying to make yesterday's "simplification" actually work...
[platform/upstream/binutils.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 cygnus_files="release release-info build-all.mk"
19
20 if ( echo $* | grep keep\-cygnus > /dev/null) ; then
21         keep_these_too="${keep_these_too} ${cygnus_files}"
22 else
23         lose_these_too="${lose_these_too} ${cygnus_files}"
24 fi
25
26 mpw_files="mpw-README mpw-configure mpw-config.in mpw-build.in ChangeLog.mpw"
27
28 if ( echo $* | grep keep\-mpw > /dev/null) ; then
29         keep_these_too="${keep_these_too} ${mpw_files}"
30 else
31         lose_these_too="${lose_these_too} ${mpw_files}"
32 fi
33
34 # All files listed between the "Things-to-keep:" line and the
35 # "Do-last:" line will be kept.  All other files will be removed.
36 # Directories listed in this section will have their own Sanitize
37 # called.  Directories not listed will be removed in their entirety
38 # with rm -rf.
39
40 Things-to-keep:
41
42 .cvsignore
43 COPYING
44 COPYING.LIB
45 CYGNUS
46 ChangeLog
47 Makefile.in
48 README
49 autoconf
50 bfd
51 binutils
52 byacc
53 config
54 config.guess
55 config.sub
56 configure
57 configure.bat
58 configure.in
59 cvs
60 deja-gnu
61 dejagnu
62 diff
63 dvips
64 emacs
65 etc
66 expect
67 fileutils
68 flex
69 gas
70 gcc
71 gdb
72 gdbm
73 gdbtest
74 glob
75 gprof
76 grep
77 groff
78 include
79 install.sh
80 ispell
81 ld
82 libg++
83 libgcc
84 libiberty
85 libio
86 m4
87 make
88 mmalloc
89 move-if-change
90 newlib
91 opcodes
92 pagas
93 patch
94 prms
95 rcs
96 readline
97 sed
98 send-pr
99 shellutils
100 sim
101 tcl
102 textutils
103 tk
104 test-build.mk
105 texinfo
106 tgas
107 utils
108 uudecode
109 wdiff
110 xiberty
111
112 Things-to-lose:
113
114 # The lines between the "Do-last:" line and the end of the file
115 # are executed as a /bin/sh shell script after everything else is
116 # done.
117
118 Do-last:
119
120 if ( echo $* | egrep verbose > /dev/null ) ; then
121         verbose=true
122 else
123         verbose=
124 fi
125
126 # Remove "sanitize-Sanitize" lines.
127 if [ -n "${verbose}" ] ; then
128         echo Cleaning unconditional sanitizations out of Makefile.in...
129 fi
130 cp Makefile.in new
131 sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
132 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
133         mv Makefile.in .Recover
134 fi
135 mv new Makefile.in
136
137 if [ -n "${verbose}" ] ; then
138         echo Looking for signs of \"v9\"...
139 fi
140
141 # Don't try to clean directories here, as the 'mv' command will fail.
142 # Also, grep fails on NFS mounted directories.
143 if ( echo $* | grep keep\-v9 > /dev/null ) ; then
144         for i in * ; do
145                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
146                         if [ -n "${verbose}" ] ; then
147                                 echo Keeping v9 stuff in $i
148                         fi
149                 fi
150         done
151 else
152         for i in * ; do
153                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
154                         if [ -n "${verbose}" ] ; then
155                                 echo Cleaning the \"v9\" out of $i...
156                         fi
157                         cp $i new
158                         sed '/start\-sanitize\-v9/,/end-\sanitize\-v9/d' < $i > new
159                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
160                                 mv $i .Recover
161                         fi
162                         mv new $i
163                 fi
164         done
165 fi
166
167 if [ -n "${verbose}" ] ; then
168         echo Thawing away the \"chill\"...
169 fi
170
171 # Don't try to clean directories here, as the 'mv' command will fail.
172 # Also, grep fails on NFS mounted directories.
173 if ( echo $* | grep keep\-chill > /dev/null ) ; then
174         for i in * ; do
175                 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
176                         if [ -n "${verbose}" ] ; then
177                                 echo Keeping chill stuff in $i
178                         fi
179                 fi
180         done
181 else
182         for i in * ; do
183                 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
184                         if [ -n "${verbose}" ] ; then
185                                 echo Thawing the \"chill\" out of $i...
186                         fi
187                         cp $i new
188                         sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
189                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
190                                 if [ -n "${verbose}" ] ; then
191                                         echo Caching $i in .Recover...
192                                 fi
193                                 mv $i .Recover
194                         fi
195                         mv new $i
196                 fi
197         done
198 fi
199
200 if [ -n "${verbose}" ] ; then
201         echo Removing traces of \"mpw\"...
202 fi
203
204 # Don't try to clean directories here, as the 'mv' command will fail.
205 # Also, grep fails on NFS mounted directories.
206 if ( echo $* | grep keep\-mpw > /dev/null ) ; then
207         for i in * ; do
208                 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
209                         if [ -n "${verbose}" ] ; then
210                                 echo Keeping mpw stuff in $i
211                         fi
212                 fi
213         done
214 else
215         for i in * ; do
216                 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
217                         if [ -n "${verbose}" ] ; then
218                                 echo Removing traces of \"mpw\" from $i...
219                         fi
220                         cp $i new
221                         sed '/start\-sanitize\-mpw/,/end-\sanitize\-mpw/d' < $i > new
222                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
223                                 if [ -n "${verbose}" ] ; then
224                                         echo Caching $i in .Recover...
225                                 fi
226                                 mv $i .Recover
227                         fi
228                         mv new $i
229                 fi
230         done
231 fi
232
233 for i in * ; do
234         if test ! -d $i && (grep sanitize $i > /dev/null) ; then
235                 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
236         fi
237 done
238
239 # eof