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.
19 # All files listed between the "Things-to-keep:" line and the
20 # "Do-last:" line will be kept. All other files will be removed.
21 # Directories listed in this section will have their own Sanitize
22 # called. Directories not listed will be removed in their entirety
121 # The lines between the "Do-last:" line and the end of the file
122 # are executed as a /bin/sh shell script after everything else is
127 v850e_files="readelf.c"
128 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
129 for i in $v850e_files ; do
130 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
131 if [ -n "${verbose}" ] ; then
132 echo Keeping v850e stuff in $i
137 for i in $v850e_files ; do
138 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
139 if [ -n "${verbose}" ] ; then
140 echo Removing traces of \"v850e\" from $i...
143 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
144 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
145 if [ -n "${verbose}" ] ; then
146 echo Caching $i in .Recover...
155 m32rx_files="readelf.c"
156 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
157 for i in $m32rx_files ; do
158 if test ! -d $i && (grep sanitize-m32rx $i > /dev/null) ; then
159 if [ -n "${verbose}" ] ; then
160 echo Keeping m32rx stuff in $i
165 for i in $m32rx_files ; do
166 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
167 if [ -n "${verbose}" ] ; then
168 echo Removing traces of \"m32rx\" from $i...
171 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
172 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
173 if [ -n "${verbose}" ] ; then
174 echo Caching $i in .Recover...
183 d30v_files="readelf.c"
184 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
185 for i in $d30v_files ; do
186 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
187 if [ -n "${verbose}" ] ; then
188 echo Keeping d30v stuff in $i
193 for i in $d30v_files ; do
194 if test -r $i && (grep sanitize-d30v $i > /dev/null) ; then
195 if [ -n "${verbose}" ] ; then
196 echo Removing traces of \"d30v\" from $i...
199 sed '/start\-sanitize\-d30v/,/end\-sanitize\-d30v/d' < $i > new
200 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
201 if [ -n "${verbose}" ] ; then
202 echo Caching $i in .Recover...
211 # This must come after all other sanitizations. Re-sanitize the .pot
213 if [ -n "${verbose}" ]; then
214 echo Re-computing files for gettext ...
217 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
218 if [ -n "${verbose}" ]; then
219 echo Caching po/POTFILES.in in .Recover...
221 mv po/POTFILES.in po/.Recover
223 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
225 if [ -n "${safe}" -a ! -f po/.Recover/binutils.pot ]; then
226 if [ -n "${verbose}" ]; then
227 echo Caching po/binutils.pot in .Recover...
229 mv po/binutils.pot po/.Recover
231 # If this fails, Sanitization must fail.
232 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/binutils.pot || exit 1