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
122 # The lines between the "Do-last:" line and the end of the file
123 # are executed as a /bin/sh shell script after everything else is
128 v850e_files="readelf.c"
129 if ( echo $* | grep keep\-v850e > /dev/null ) ; then
130 for i in $v850e_files ; do
131 if test ! -d $i && (grep sanitize-v850e $i > /dev/null) ; then
132 if [ -n "${verbose}" ] ; then
133 echo Keeping v850e stuff in $i
138 for i in $v850e_files ; do
139 if test -r $i && (grep sanitize-v850e $i > /dev/null) ; then
140 if [ -n "${verbose}" ] ; then
141 echo Removing traces of \"v850e\" from $i...
144 sed '/start\-sanitize\-v850e/,/end\-sanitize\-v850e/d' < $i > new
145 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
146 if [ -n "${verbose}" ] ; then
147 echo Caching $i in .Recover...
156 m32rx_files="readelf.c"
157 if ( echo $* | grep keep\-m32rx > /dev/null ) ; then
158 for i in $m32rx_files ; do
159 if test ! -d $i && (grep sanitize-m32rx $i > /dev/null) ; then
160 if [ -n "${verbose}" ] ; then
161 echo Keeping m32rx stuff in $i
166 for i in $m32rx_files ; do
167 if test -r $i && (grep sanitize-m32rx $i > /dev/null) ; then
168 if [ -n "${verbose}" ] ; then
169 echo Removing traces of \"m32rx\" from $i...
172 sed '/start\-sanitize\-m32rx/,/end\-sanitize\-m32rx/d' < $i > new
173 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
174 if [ -n "${verbose}" ] ; then
175 echo Caching $i in .Recover...
184 d30v_files="readelf.c"
185 if ( echo $* | grep keep\-d30v > /dev/null ) ; then
186 for i in $d30v_files ; do
187 if test ! -d $i && (grep sanitize-d30v $i > /dev/null) ; then
188 if [ -n "${verbose}" ] ; then
189 echo Keeping d30v stuff in $i
194 for i in $d30v_files ; do
195 if test -r $i && (grep sanitize-d30v $i > /dev/null) ; then
196 if [ -n "${verbose}" ] ; then
197 echo Removing traces of \"d30v\" from $i...
200 sed '/start\-sanitize\-d30v/,/end\-sanitize\-d30v/d' < $i > new
201 if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
202 if [ -n "${verbose}" ] ; then
203 echo Caching $i in .Recover...
212 # This must come after all other sanitizations. Re-sanitize the .pot
214 if [ -n "${verbose}" ]; then
215 echo Re-computing files for gettext ...
218 if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
219 if [ -n "${verbose}" ]; then
220 echo Caching po/POTFILES.in in .Recover...
222 mv po/POTFILES.in po/.Recover
224 find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
226 if [ -n "${safe}" -a ! -f po/.Recover/binutils.pot ]; then
227 if [ -n "${verbose}" ]; then
228 echo Caching po/binutils.pot in .Recover...
230 mv po/binutils.pot po/.Recover
232 # If this fails, Sanitization must fail.
233 xgettext -c -k_ -kN_ -f po/POTFILES.in -o po/binutils.pot || exit 1