+2001-11-06 Paolo Bonzini <bonzini@gnu.org>
+ Bruno Haible <haible@clisp.cons.org>
+
+ * Makefile.in.in (update-po): Avoid writing in $(srcdir) unless
+ absolutely necessary. Writing in the builddir is allowed, though.
+
2001-11-05 Bruno Haible <haible@clisp.cons.org>
* de.po: Update from Karl Eichwalder.
update-po: Makefile
$(MAKE) $(PACKAGE).pot
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
+ tmpdir=`pwd`; \
cd $(srcdir); \
catalogs='$(GMOFILES)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
lang=`echo $$cat | sed 's/\.gmo$$//'`; \
echo "$$lang:"; \
- if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
- mv -f $$lang.new.po $$lang.po; \
+ if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$tmpdir/$$lang.new.po; then \
+ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$cat failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ exit 1; \
+ fi; \
+ fi; \
else \
- echo "msgmerge for $$cat failed!"; \
- rm -f $$lang.new.po; \
+ echo "msgmerge for $$cat failed!" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
fi; \
done
$(MAKE) update-gmo