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