Support for opcodes directory
[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 # All files listed between the "Things-to-keep:" line and the
19 # "Do-last:" line will be kept.  All other files will be removed.
20 # Directories listed in this section will have their own Sanitize
21 # called.  Directories not listed will be removed in their entirety
22 # with rm -rf.
23
24 Things-to-keep:
25
26 .cvsignore
27 CYGNUS
28 ChangeLog
29 INSTALL
30 Makefile.in
31 README
32 SUPPORTED
33 autoconf
34 bfd
35 binutils
36 byacc
37 cfg-paper.texi
38 config
39 config.sub
40 configure
41 configure.bat
42 configure.in
43 configure.man
44 configure.texi
45 cvs
46 diff
47 emacs
48 flex
49 gas
50 gcc
51 gdb
52 gdbm
53 gdbtest
54 glob
55 gprof
56 grep
57 include
58 install.texinfo
59 ispell
60 ld
61 libg++
62 libgcc
63 libiberty
64 make
65 mmalloc
66 move-if-change
67 newlib
68 opcodes
69 patch
70 prms
71 rcs
72 readline
73 send_pr
74 standards.texi
75 test-build.mk
76 texinfo
77 tgas
78
79 # The lines between the "Do-last:" line and the end of the file
80 # are executed as a /bin/sh shell script after everything else is
81 # done.
82
83 Do-last:
84
85 echo Looking for signs of \"v9\"...
86
87 # Don't try to clean directories here, as the 'mv' command will fail.
88 # Also, grep fails on NFS mounted directories.
89 if ( echo $* | grep keep\-v9 > /dev/null ) ; then
90         for i in * ; do
91                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
92                         echo Keeping v9 stuff in $i
93                 fi
94         done
95 else
96         for i in * ; do
97                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
98                         echo Cleaning the \"v9\" out of $i...
99                         cp $i new
100                         sed '/start\-sanitize\-v9/,/end-\sanitize\-v9/d' < $i > new
101                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
102                                 mv $i .Recover
103                         fi
104                         mv new $i
105                 fi
106         done
107 fi
108
109 echo Looking for signs of \"life\"...
110
111 # Don't try to clean directories here, as the 'mv' command will fail.
112 # Also, grep fails on NFS mounted directories.
113 if ( echo $* | grep keep\-life > /dev/null ) ; then
114         for i in * ; do
115                 if test ! -d $i && (grep sanitize-life $i > /dev/null) ; then
116                         echo Keeping life alive in $i
117                 fi
118         done
119 else
120         for i in * ; do
121                 if test ! -d $i && (grep sanitize-life $i > /dev/null) ; then
122                         echo Beating the \"life\" out of $i...
123                         cp $i new
124                         sed '/start\-sanitize\-life/,/end-\sanitize\-life/d' < $i > new
125                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
126                                 mv $i .Recover
127                         fi
128                         mv new $i
129                 fi
130         done
131 fi
132
133 for i in * ; do
134         if test ! -d $i && (grep sanitize $i > /dev/null) ; then
135                 echo Some mentions of Sanitize are still left in $i!
136         fi
137 done
138
139 # eof