1 # .Sanitize for devo/binutils
3 # Each directory to survive its 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.
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
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.
20 if ( echo $* | grep keep\-sky > /dev/null ) ; then
21 keep_these_too="${sky_files} ${keep_these_too}"
23 lose_these_too="${sky_files} ${lose_these_too}"
26 # All files listed between the "Things-to-keep:" line and the
27 # "Do-last:" line will be kept. All other files will be removed.
28 # Directories listed in this section will have their own Sanitize
29 # called. Directories not listed will be removed in their entirety
133 # The lines between the "Do-last:" line and the end of the file
134 # are executed as a /bin/sh shell script after everything else is
139 v850e_files="readelf.c"
140 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
141 for i in $v850e_files ; do
142 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
143 if [ -n "${verbose}" ] ; then
144 echo Keeping v850e stuff in $i
149 for i in $v850e_files ; do
150 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
151 if [ -n "${verbose}" ] ; then
152 echo Removing traces of \"v850e\" from $i...
155 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
156 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
157 if [ -n "${verbose}" ] ; then
158 echo Caching $i in .Recover...
167 m32rx_files="readelf.c"
168 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
169 for i in $m32rx_files ; do
170 if test ! -d $i && (grep sanitize-m32rx $i > /dev/null) ; then
171 if [ -n "${verbose}" ] ; then
172 echo Keeping m32rx stuff in $i
177 for i in $m32rx_files ; do
178 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
179 if [ -n "${verbose}" ] ; then
180 echo Removing traces of \"m32rx\" from $i...
183 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
184 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
185 if [ -n "${verbose}" ] ; then
186 echo Caching $i in .Recover...
195 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure"
196 if ( echo $* | grep keep\-sky > /dev/null ) ; then
197 for i in $sky_files ; do
198 if test ! -d $i && (grep 'sanitize[-_]sky' $i > /dev/null) ; then
199 if [ -n "${verbose}" ] ; then
200 echo Keeping sky stuff in $i
205 for i in $sky_files ; do
206 if test ! -d $i && (grep 'sanitize[-_]sky' $i > /dev/null) ; then
207 if [ -n "${verbose}" ] ; then
208 echo Removing traces of \"sky\" from $i...
211 sed '/start[-_]sanitize[-_]sky/,/end[-_]sanitize[-_]sky/d' < $i > new
212 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
213 if [ -n "${verbose}" ] ; then
214 echo Caching $i in .Recover...
223 # This must come after all other sanitizations. Re-sanitize the .pot
225 if [ -n "${verbose}" ]; then
226 echo Re-computing files for gettext ...
229 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
230 if [ -n "${verbose}" ]; then
231 echo Caching po/POTFILES.in in .Recover...
233 mv po/POTFILES.in po/.Recover
235 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
237 if [ -n "${safe}" -a ! -f po/.Recover/binutils.pot ]; then
238 if [ -n "${verbose}" ]; then
239 echo Caching po/binutils.pot in .Recover...
241 mv po/binutils.pot po/.Recover
243 # If this fails, Sanitization must fail.
244 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/binutils.pot || exit 1