*** empty log message ***
[external/binutils.git] / .Sanitize
1 # Sanitize.in for devo.
2 # $Id$
3 #
4
5 # Each directory to survive it's way into a release will need a file
6 # like this one called "./.Sanitize".  All keyword lines must exist,
7 # and must exist in the order specified by this file.  Each directory
8 # in the tree will be processed, top down, in the following order.
9
10 # Hash started lines like this one are comments and will be deleted
11 # before anything else is done.  Blank lines will also be squashed
12 # out.
13
14 # The lines between the "Do-first:" line and the "Things-to-keep:"
15 # line are executed as a /bin/sh shell script before anything else is
16 # done in this 
17
18 Do-first:
19
20 echo Sanitizing `pwd`...
21
22 # All files listed between the "Things-to-keep:" line and the
23 # "Files-to-sed:" line will be kept.  All other files will be removed.
24 # Directories listed in this section will have their own Sanitize
25 # called.  Directories not listed will be removed in their entirety
26 # with rm -rf.
27
28 Things-to-keep:
29
30 Makefile.in
31 README
32 README.configure
33 bison
34 bfd
35 binutils
36 clib
37 config
38 config.sub
39 configure
40 configure.in
41 cvs
42 diff
43 emacs
44 gas
45 gcc
46 gdb
47 gdbm
48 gnulib
49 grep
50 include
51 ld
52 libiberty
53 make
54 prms
55 rcs
56 readline
57 texinfo
58
59 Do-last:
60
61 echo Looking for signs of \"v9\"...
62
63 # Don't try to clean directories here, as the 'mv' command will fail.
64 # Also, grep fails on NFS mounted directories.
65 if ( echo $* | grep keep\-v9 > /dev/null ) ; then
66         for i in * ; do
67                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
68                         echo Keeping v9 stuff in $i
69                 fi
70         done
71 else
72         for i in * ; do
73                 if test ! -d $i && (grep sanitize-v9 $i > /dev/null) ; then
74                         echo Cleaning the \"v9\" out of $i...
75                         cp $i new
76                         sed '/start\-sanitize\-v9/,/end-\sanitize\-v9/d' < $i > new
77                         if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
78                                 mv $i .Recover
79                         fi
80                         mv new $i
81                 fi
82         done
83 fi
84
85 echo Looking for signs of \"life\"...
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\-life > /dev/null ) ; then
90         for i in * ; do
91                 if test ! -d $i && (grep sanitize-life $i > /dev/null) ; then
92                         echo Keeping life alive in $i
93                 fi
94         done
95 else
96         for i in * ; do
97                 if test ! -d $i && (grep sanitize-life $i > /dev/null) ; then
98                         echo Beating the \"life\" out of $i...
99                         cp $i new
100                         sed '/start\-sanitize\-life/,/end-\sanitize\-life/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 if grep 'sanitize' * ; then
110         echo Some mentions of Sanitize are still left in the sources!
111 fi
112
113 echo Done in `pwd`.