mirror of
https://github.com/coreutils/coreutils.git
synced 2024-11-26 11:23:47 +08:00
(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.
This commit is contained in:
parent
c730e2d9e8
commit
d6b863b09c
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user