diff options
author | Jim Meyering <jim@meyering.net> | 2001-01-14 09:41:53 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-01-14 09:41:53 +0000 |
commit | d6b863b09c8d9e1a9b9caa8848c68c7f59a2a1e0 (patch) | |
tree | f583bd86cc325fb159f8b8ee451120b726967b1f /po | |
parent | c730e2d9e8e9f9c7def6ea50afe38cb3d0795ec2 (diff) | |
download | coreutils-d6b863b09c8d9e1a9b9caa8848c68c7f59a2a1e0.tar.xz |
(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.
Diffstat (limited to 'po')
-rw-r--r-- | po/Makefile.in.in | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/po/Makefile.in.in b/po/Makefile.in.in index fcb6ac357..f9b34042d 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 |