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