From: Jim Meyering Date: Sun, 14 Jan 2001 09:41:53 +0000 (+0000) Subject: (update-po): Merge po-files in temporary files X-Git-Tag: FILEUTILS-4_0_36~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d6b863b09c8d9e1a9b9caa8848c68c7f59a2a1e0;p=thirdparty%2Fcoreutils.git (update-po): Merge po-files in temporary files in the build directory, and update the source directory only when the merged catalog differs from the original. This fixes the known `make distcheck' failure due to `make update-po' being called on up-to-date but read-only files. --- diff --git a/po/Makefile.in.in b/po/Makefile.in.in index fcb6ac3572..f9b34042d5 100644 --- a/po/Makefile.in.in +++ b/po/Makefile.in.in @@ -213,20 +213,25 @@ dist distdir: update-po $(DISTFILES) update-po: Makefile $(MAKE) $(PACKAGE).pot - PATH=`pwd`/../src:$$PATH; \ - cd $(srcdir); \ catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - mv $$lang.po $$lang.old.po; \ echo "$$lang:"; \ - if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ - rm -f $$lang.old.po; \ + if $(MSGMERGE) $(srcdir)/$$lang.po \ + $(srcdir)/$(PACKAGE).pot -o $$lang.new.po; then \ + if cmp $$lang.new.po $(srcdir)/$$lang.po >/dev/null; then \ + echo "$$lang.po is unchanged"; \ + rm -f $$lang.new.po; \ + else \ + echo "updating $$lang.po"; \ + rm -f $(srcdir)/$$lang.po; \ + mv $$lang.new.po $(srcdir)/$$lang.po; \ + fi; \ else \ echo "msgmerge for $$cat failed!"; \ - rm -f $$lang.po; \ - mv $$lang.old.po $$lang.po; \ + rm -f $$lang.new.po; \ + exit 1; \ fi; \ done