Fixed xgettext invocation in .Sanitize files
[binutils-gdb.git] / bfd / .Sanitize
index 300aad51514305081b7c3932defb016a50ce16a1..24ac3ed5672a51c4274c2df96fb84fa641c2123b 100644 (file)
@@ -614,4 +614,28 @@ for i in * ; do
        fi
 done
 
+
+# This must come after all other sanitizations.  Re-sanitize the .pot
+# file.
+if [ -n "${verbose}" ]; then
+   echo Re-computing files for gettext ...
+fi
+
+if [ -n "${safe}" -a ! -f po/.Recover/POTFILES.in ]; then
+   if [ -n "${verbose}" ]; then
+      echo Caching po/POTFILES.in in .Recover...
+   fi
+   mv po/POTFILES.in po/.Recover
+fi
+find . -name '*.[ch]' | sed -e 's,^\./,,' > po/POTFILES.in
+
+if [ -n "${safe}" -a ! -f po/.Recover/bfd.pot ]; then
+   if [ -n "${verbose}" ]; then
+      echo Caching po/bfd.pot in .Recover...
+   fi
+   mv po/bfd.pot po/.Recover
+fi
+# If this fails, Sanitization must fail.
+xgettext -c -k _ -k N_ -f po/POTFILES.in -o po/bfd.pot || exit 1
+
 # eof