Commit | Line | Data |
---|---|---|
43e36dd2 | 1 | # .Sanitize for devo. |
a93b3c77 | 2 | |
5db7ecb7 | 3 | # Each directory to survive its way into a release will need a file |
a93b3c77 RP |
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 | |
43e36dd2 | 14 | # done in this directory. |
a93b3c77 RP |
15 | |
16 | Do-first: | |
17 | ||
1ed0529e | 18 | keep_these_too="${keep_these_too} .cvsignore CYGNUS autoconf |
e03b0bca KR |
19 | bfd binutils byacc cvs deja-gnu dejagnu diff dosrel dvips emacs emacs19 |
20 | examples expect fileutils flex gas gcc gdb gdbm gdbtest glob gprof grep | |
21 | groff include install.sh ispell ld libg++ libgcc libgloss libiberty | |
f38cb096 JM |
22 | libio librx libstdc++ m4 make mmalloc move-if-change newlib opcodes |
23 | pagas patch prms rcs readline sed send-pr shellutils sim tcl textutils | |
24 | tk test-build.mk texinfo tgas utils uudecode wdiff xiberty" | |
e03b0bca | 25 | |
1ed0529e | 26 | cygnus_files="release release-info build-all.mk COPYING.NEWLIB" |
96c805d8 | 27 | |
7d0eab7b | 28 | if ( echo $* | grep keep\-cygnus > /dev/null) ; then |
96c805d8 | 29 | keep_these_too="${keep_these_too} ${cygnus_files}" |
80cad9cc | 30 | else |
96c805d8 | 31 | lose_these_too="${lose_these_too} ${cygnus_files}" |
7d0eab7b DZ |
32 | fi |
33 | ||
eccc57e5 | 34 | mpw_files="mpw-README mpw-configure mpw-config.in mpw-build.in ChangeLog.mpw" |
96c805d8 | 35 | |
5db7ecb7 | 36 | if ( echo $* | grep keep\-mpw > /dev/null) ; then |
96c805d8 | 37 | keep_these_too="${keep_these_too} ${mpw_files}" |
5db7ecb7 | 38 | else |
96c805d8 | 39 | lose_these_too="${lose_these_too} ${mpw_files}" |
5db7ecb7 | 40 | fi |
7d0eab7b | 41 | |
e03b0bca KR |
42 | # This top-level directory is special. We often check out only subsets |
43 | # of this directory, and complaining about directories or files we didn't | |
44 | # check out just gets obnoxious. | |
45 | ||
46 | list="${keep_these_too}" | |
47 | keep_these_too= | |
48 | ||
49 | for file in $list ; do | |
50 | if [ -r $file ] || [ -d $file ] ; then | |
51 | keep_these_too="${keep_these_too} $file" | |
52 | fi | |
53 | done | |
54 | ||
55 | list="${lose_these_too}" | |
56 | lose_these_too= | |
57 | ||
58 | for file in $list ; do | |
59 | if [ -r $file ] || [ -d $file ] ; then | |
60 | lose_these_too="${lose_these_too} $file" | |
61 | fi | |
62 | done | |
63 | ||
a93b3c77 | 64 | # All files listed between the "Things-to-keep:" line and the |
43e36dd2 | 65 | # "Do-last:" line will be kept. All other files will be removed. |
a93b3c77 RP |
66 | # Directories listed in this section will have their own Sanitize |
67 | # called. Directories not listed will be removed in their entirety | |
68 | # with rm -rf. | |
69 | ||
70 | Things-to-keep: | |
71 | ||
6e37b215 PB |
72 | COPYING |
73 | COPYING.LIB | |
57d32184 | 74 | ChangeLog |
a93b3c77 | 75 | Makefile.in |
965a9f14 | 76 | README |
a93b3c77 | 77 | config |
5cc24596 | 78 | config.guess |
db2de419 | 79 | config.sub |
a93b3c77 RP |
80 | configure |
81 | configure.in | |
701df845 | 82 | etc |
a93b3c77 | 83 | |
87756e15 RP |
84 | Things-to-lose: |
85 | ||
43e36dd2 RP |
86 | # The lines between the "Do-last:" line and the end of the file |
87 | # are executed as a /bin/sh shell script after everything else is | |
88 | # done. | |
89 | ||
a93b3c77 RP |
90 | Do-last: |
91 | ||
7b85349f RP |
92 | if ( echo $* | egrep verbose > /dev/null ) ; then |
93 | verbose=true | |
94 | else | |
95 | verbose= | |
96 | fi | |
97 | ||
eecef7ef FF |
98 | # Remove "sanitize-Sanitize" lines. |
99 | if [ -n "${verbose}" ] ; then | |
100 | echo Cleaning unconditional sanitizations out of Makefile.in... | |
101 | fi | |
102 | cp Makefile.in new | |
103 | sed '/start\-sanitize\-Sanitize/,/end-\sanitize\-Sanitize/d' < Makefile.in > new | |
104 | if [ -n "${safe}" -a ! -f .Recover/Makefile.in ] ; then | |
105 | mv Makefile.in .Recover | |
106 | fi | |
107 | mv new Makefile.in | |
108 | ||
7b85349f RP |
109 | if [ -n "${verbose}" ] ; then |
110 | echo Thawing away the \"chill\"... | |
111 | fi | |
5d4ec851 FF |
112 | |
113 | # Don't try to clean directories here, as the 'mv' command will fail. | |
114 | # Also, grep fails on NFS mounted directories. | |
115 | if ( echo $* | grep keep\-chill > /dev/null ) ; then | |
116 | for i in * ; do | |
117 | if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then | |
7b85349f RP |
118 | if [ -n "${verbose}" ] ; then |
119 | echo Keeping chill stuff in $i | |
120 | fi | |
5d4ec851 FF |
121 | fi |
122 | done | |
123 | else | |
124 | for i in * ; do | |
125 | if test ! -d $i && (grep sanitize-chill $i > /dev/null) ; then | |
7b85349f RP |
126 | if [ -n "${verbose}" ] ; then |
127 | echo Thawing the \"chill\" out of $i... | |
128 | fi | |
5d4ec851 FF |
129 | cp $i new |
130 | sed '/start\-sanitize\-chill/,/end-\sanitize\-chill/d' < $i > new | |
131 | if [ -n "${safe}" -a ! -f .Recover/$i ] ; then | |
7b85349f RP |
132 | if [ -n "${verbose}" ] ; then |
133 | echo Caching $i in .Recover... | |
134 | fi | |
5d4ec851 FF |
135 | mv $i .Recover |
136 | fi | |
137 | mv new $i | |
138 | fi | |
139 | done | |
5d4ec851 FF |
140 | fi |
141 | ||
5db7ecb7 SS |
142 | if [ -n "${verbose}" ] ; then |
143 | echo Removing traces of \"mpw\"... | |
144 | fi | |
145 | ||
146 | # Don't try to clean directories here, as the 'mv' command will fail. | |
147 | # Also, grep fails on NFS mounted directories. | |
148 | if ( echo $* | grep keep\-mpw > /dev/null ) ; then | |
149 | for i in * ; do | |
150 | if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then | |
151 | if [ -n "${verbose}" ] ; then | |
152 | echo Keeping mpw stuff in $i | |
153 | fi | |
154 | fi | |
155 | done | |
156 | else | |
157 | for i in * ; do | |
158 | if test ! -d $i && (grep sanitize-mpw $i > /dev/null) ; then | |
159 | if [ -n "${verbose}" ] ; then | |
160 | echo Removing traces of \"mpw\" from $i... | |
161 | fi | |
162 | cp $i new | |
163 | sed '/start\-sanitize\-mpw/,/end-\sanitize\-mpw/d' < $i > new | |
164 | if [ -n "${safe}" -a ! -f .Recover/$i ] ; then | |
165 | if [ -n "${verbose}" ] ; then | |
166 | echo Caching $i in .Recover... | |
167 | fi | |
168 | mv $i .Recover | |
169 | fi | |
170 | mv new $i | |
171 | fi | |
172 | done | |
173 | fi | |
174 | ||
86118528 KR |
175 | if [ -n "${verbose}" ] ; then |
176 | echo Processing \"arc\"... | |
177 | fi | |
178 | ||
179 | # Don't try to clean directories here, as the 'mv' command will fail. | |
180 | # Also, grep fails on NFS mounted directories. | |
181 | if ( echo $* | grep keep\-arc > /dev/null ) ; then | |
182 | for i in * ; do | |
183 | if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then | |
184 | if [ -n "${verbose}" ] ; then | |
185 | echo Keeping arc stuff in $i | |
186 | fi | |
187 | fi | |
188 | done | |
189 | else | |
190 | for i in * ; do | |
191 | if test ! -d $i && (grep sanitize-arc $i > /dev/null) ; then | |
192 | if [ -n "${verbose}" ] ; then | |
193 | echo Removing traces of \"arc\" from $i... | |
194 | fi | |
195 | cp $i new | |
196 | sed '/start\-sanitize\-arc/,/end-\sanitize\-arc/d' < $i > new | |
197 | if [ -n "${safe}" -a ! -f .Recover/$i ] ; then | |
198 | if [ -n "${verbose}" ] ; then | |
199 | echo Caching $i in .Recover... | |
200 | fi | |
201 | mv $i .Recover | |
202 | fi | |
203 | mv new $i | |
204 | fi | |
205 | done | |
206 | fi | |
207 | ||
e11b54be PB |
208 | for i in * ; do |
209 | if test ! -d $i && (grep sanitize $i > /dev/null) ; then | |
7b85349f | 210 | echo '***' Some mentions of Sanitize are still left in $i! 1>&2 |
e11b54be PB |
211 | fi |
212 | done | |
57d32184 RP |
213 | |
214 | # eof |