Keep/lose arc stuff.
[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 COPYING.NEWLIB"
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.in
58 cvs
59 deja-gnu
60 dejagnu
61 diff
62 dosrel
63 dvips
64 emacs
65 emacs19
66 etc
67 examples
68 expect
69 fileutils
70 flex
71 gas
72 gcc
73 gdb
74 gdbm
75 gdbtest
76 glob
77 gprof
78 grep
79 groff
80 include
81 install.sh
82 ispell
83 ld
84 libg++
85 libgcc
86 libgloss
87 libiberty
88 libio
89 librx
90 m4
91 make
92 mmalloc
93 move-if-change
94 newlib
95 opcodes
96 pagas
97 patch
98 prms
99 rcs
100 readline
101 sed
102 send-pr
103 shellutils
104 sim
105 tcl
106 textutils
107 tk
108 test-build.mk
109 texinfo
110 tgas
111 utils
112 uudecode
113 wdiff
114 xiberty
115
116 Things-to-lose:
117
118 # The lines between the "Do-last:" line and the end of the file
119 # are executed as a /bin/sh shell script after everything else is
120 # done.
121
122 Do-last:
123
124 if ( echo $* | egrep verbose > /dev/null ) ; then
125         verbose=true
126 else
127         verbose=
128 fi
129
130 # Remove "sanitize-Sanitize" lines.
131 if [ -n "${verbose}" ] ; then
132         echo Cleaning unconditional sanitizations out of Makefile.in...
133 fi
134 cp Makefile.in new
135 sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new
136 if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then
137         mv Makefile.in .Recover
138 fi
139 mv new Makefile.in
140
141 if [ -n "${verbose}" ] ; then
142         echo Thawing away the \"chill\"...
143 fi
144
145 # Don't try to clean directories here, as the 'mv' command will fail.
146 # Also, grep fails on NFS mounted directories.
147 if ( echo $* | grep keep\-chill > /dev/null ) ; then
148         for i in * ; do
149                 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
150                         if [ -n "${verbose}" ] ; then
151                                 echo Keeping chill stuff in $i
152                         fi
153                 fi
154         done
155 else
156         for i in * ; do
157                 if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then
158                         if [ -n "${verbose}" ] ; then
159                                 echo Thawing the \"chill\" out of $i...
160                         fi
161                         cp $i new
162                         sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new
163                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
164                                 if [ -n "${verbose}" ] ; then
165                                         echo Caching $i in .Recover...
166                                 fi
167                                 mv $i .Recover
168                         fi
169                         mv new $i
170                 fi
171         done
172 fi
173
174 if [ -n "${verbose}" ] ; then
175         echo Removing traces of \"mpw\"...
176 fi
177
178 # Don't try to clean directories here, as the 'mv' command will fail.
179 # Also, grep fails on NFS mounted directories.
180 if ( echo $* | grep keep\-mpw > /dev/null ) ; then
181         for i in * ; do
182                 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
183                         if [ -n "${verbose}" ] ; then
184                                 echo Keeping mpw stuff in $i
185                         fi
186                 fi
187         done
188 else
189         for i in * ; do
190                 if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then
191                         if [ -n "${verbose}" ] ; then
192                                 echo Removing traces of \"mpw\" from $i...
193                         fi
194                         cp $i new
195                         sed '/start\-sanitize\-mpw/,/end-\sanitize\-mpw/d' < $i > new
196                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
197                                 if [ -n "${verbose}" ] ; then
198                                         echo Caching $i in .Recover...
199                                 fi
200                                 mv $i .Recover
201                         fi
202                         mv new $i
203                 fi
204         done
205 fi
206
207 if [ -n "${verbose}" ] ; then
208         echo Processing \"arc\"...
209 fi
210
211 # Don't try to clean directories here, as the 'mv' command will fail.
212 # Also, grep fails on NFS mounted directories.
213 if ( echo $* | grep keep\-arc > /dev/null ) ; then
214         for i in * ; do
215                 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
216                         if [ -n "${verbose}" ] ; then
217                                 echo Keeping arc stuff in $i
218                         fi
219                 fi
220         done
221 else
222         for i in * ; do
223                 if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then
224                         if [ -n "${verbose}" ] ; then
225                                 echo Removing traces of \"arc\" from $i...
226                         fi
227                         cp $i new
228                         sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new
229                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
230                                 if [ -n "${verbose}" ] ; then
231                                         echo Caching $i in .Recover...
232                                 fi
233                                 mv $i .Recover
234                         fi
235                         mv new $i
236                 fi
237         done
238 fi
239
240 for i in * ; do
241         if test ! -d $i && (grep sanitize $i > /dev/null) ; then
242                 echo '***' Some mentions of Sanitize are still left in $i! 1>&2
243         fi
244 done
245
246 # eof