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 cygnus_files="readelf.c"
140 if ( echo $* | grep keep\-cygnus > /dev/null ) ; then
141 for i in $cygnus_files ; do
142 if test ! -d $i && (grep sanitize-cygnus $i > /dev/null) ; then
143 if [ -n "${verbose}" ] ; then
144 echo Keeping cygnus stuff in $i
149 for i in $cygnus_files ; do
150 if test -r $i && (grep sanitize-cygnus $i > /dev/null) ; then
151 if [ -n "${verbose}" ] ; then
152 echo Removing traces of \"cygnus\" from $i...
155 sed '/start\-sanitize\-cygnus/,/end\-sanitize\-cygnus/d' < $i > new
156 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
157 if [ -n "${verbose}" ] ; then
158 echo Caching $i in .Recover...
167 sky_files="ChangeLog Makefile.in Makefile.am configure.in configure"
168 if ( echo $* | grep keep\-sky > /dev/null ) ; then
169 for i in $sky_files ; do
170 if test ! -d $i && (grep 'sanitize[-_]sky' $i > /dev/null) ; then
171 if [ -n "${verbose}" ] ; then
172 echo Keeping sky stuff in $i
177 for i in $sky_files ; do
178 if test ! -d $i && (grep 'sanitize[-_]sky' $i > /dev/null) ; then
179 if [ -n "${verbose}" ] ; then
180 echo Removing traces of \"sky\" from $i...
183 sed '/start[-_]sanitize[-_]sky/,/end[-_]sanitize[-_]sky/d' < $i > new
184 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
185 if [ -n "${verbose}" ] ; then
186 echo Caching $i in .Recover...
195 # This must come after all other sanitizations. Re-sanitize the .pot
197 if [ -n "${verbose}" ]; then
198 echo Re-computing files for gettext ...
201 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
202 if [ -n "${verbose}" ]; then
203 echo Caching po/POTFILES.in in .Recover...
205 mv po/POTFILES.in po/.Recover
207 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
209 if [ -n "${safe}" -a ! -f po/.Recover/binutils.pot ]; then
210 if [ -n "${verbose}" ]; then
211 echo Caching po/binutils.pot in .Recover...
213 mv po/binutils.pot po/.Recover
215 # If this fails, Sanitization must fail.
216 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/binutils.pot || exit 1