summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--po/ChangeLog6
-rw-r--r--po/Makefile.in.in18
2 files changed, 20 insertions, 4 deletions
diff --git a/po/ChangeLog b/po/ChangeLog
index 3e77026..156d208 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,9 @@
+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.
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index 22b55e9..dee3276 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -184,17 +184,27 @@ dist2: $(DISTFILES)
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