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