]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(update-po): Merge po-files in temporary files
authorJim Meyering <jim@meyering.net>
Sun, 14 Jan 2001 09:41:53 +0000 (09:41 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 14 Jan 2001 09:41:53 +0000 (09:41 +0000)
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.

po/Makefile.in.in

index fcb6ac35723270b54335202633cddf496e22dbb3..f9b34042d5bf850cf2915fe3a73a289a8dbe7d81 100644 (file)
@@ -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