2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-29 05:17:54 +00:00

Add check for out of date message catalogs when doing "make dist".

This commit is contained in:
Todd C. Miller 2011-08-05 12:33:40 -04:00
parent f922678360
commit 53656020f7

View File

@ -170,39 +170,59 @@ sync-po:
rsync -Lrtvz translationproject.org::tp/latest/sudoers/ plugins/sudoers/po/ rsync -Lrtvz translationproject.org::tp/latest/sudoers/ plugins/sudoers/po/
update-pot: update-pot:
@cd $(top_srcdir); \ @if $(XGETTEXT) --help >/dev/null 2>&1; then \
for pot in $(POTFILES); do \ cd $(top_srcdir); \
echo "Updating $$pot"; \ for pot in $(POTFILES); do \
domain=`basename $$pot .pot`; \ echo "Updating $$pot"; \
case "$$domain" in \ domain=`basename $$pot .pot`; \
sudo) cfiles="src/*c common/*c compat/*c";; \ case "$$domain" in \
sudoers) cfiles="plugins/sudoers/*.c plugins/sudoers/auth/*.c";; \ sudo) cfiles="src/*c common/*c compat/*c";; \
*) echo unknown domain $$domain; continue;; \ sudoers) cfiles="plugins/sudoers/*.c plugins/sudoers/auth/*.c";; \
esac; \ *) echo unknown domain $$domain; continue;; \
$(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles -o $$pot; \ esac; \
done $(XGETTEXT) $(XGETTEXT_OPTS) -d$$domain $$cfiles -o $$pot.tmp; \
if diff -I'^.POT-Creation-Date' $$pot.tmp $$pot >/dev/null; then \
mv -f $$pot.tmp $$pot; \
else \
rm -f $$pot.tmp; \
fi; \
done; \
fi
update-po: update-pot update-po: update-pot
@cd $(top_srcdir); \ @if $(MSGFMT) --help >/dev/null 2>&1; then \
for pot in $(POTFILES); do \ cd $(top_srcdir); \
podir=`dirname $$pot`; \ for pot in $(POTFILES); do \
for po in $$podir/*.po; do \ podir=`dirname $$pot`; \
echo $(ECHO_N) "Updating $$po$(ECHO_C)"; \ for po in $$podir/*.po; do \
$(MSGMERGE) --update $$po $$pot; \ echo $(ECHO_N) "Updating $$po$(ECHO_C)"; \
$(MSGFMT) --output /dev/null --check-format $$po || exit 1; \ $(MSGMERGE) --update $$po $$pot; \
$(MSGFMT) --output /dev/null --check-format $$po || exit 1; \
done; \
done; \ done; \
done fi
compile-po: compile-po:
@cd $(top_srcdir); \ @if $(MSGFMT) --help >/dev/null 2>&1; then \
for pot in $(POTFILES); do \ cd $(top_srcdir); \
podir=`dirname $$pot`; \ rm -f Makefile.$$$$; \
for po in $$podir/*.po; do \ POFILES=""; \
mo=`echo $$po | sed 's/po$$/mo/'`; \ for pot in $(POTFILES); do \
echo $(ECHO_N) "Compiling $$mo: $(ECHO_C)"; \ podir=`dirname $$pot`; \
$(MSGFMT) --statistics -c -o $$mo $$po; \ for po in $$podir/*.po; do \
POFILES="$$POFILES $$po"; \
done; \
done; \ done; \
done echo "all: `echo $$POFILES | sed 's/\.po/.mo/g'`" >> Makefile.$$$$; \
echo "" >> Makefile.$$$$; \
for po in $$POFILES; do \
mo=`echo $$po | sed 's/po$$/mo/'`; \
echo "$$mo: $$po" >> Makefile.$$$$; \
echo " $(MSGFMT) --statistics -c -o $$mo $$po" >> Makefile.$$$$; \
done; \
make -f Makefile.$$$$; \
rm -f Makefile.$$$$; \
fi
install-nls: install-nls:
@if test "$(NLS)" = "enabled"; then \ @if test "$(NLS)" = "enabled"; then \
@ -221,7 +241,15 @@ install-nls:
done; \ done; \
fi fi
dist: ChangeLog $(srcdir)/MANIFEST check-dist: update-pot compile-po
@if [ -d .hg ]; then \
if hg stat -am | grep '\.[mp]ot*$$'; then \
echo "Uncommitted message catalog changes" 1>&2; \
false; \
fi; \
fi
dist: check-dist ChangeLog $(srcdir)/MANIFEST
pax -w -x ustar -s '/^/$(PACKAGE_TARNAME)-$(VERSION)\//' \ pax -w -x ustar -s '/^/$(PACKAGE_TARNAME)-$(VERSION)\//' \
-f ../$(PACKAGE_TARNAME)-$(VERSION).tar \ -f ../$(PACKAGE_TARNAME)-$(VERSION).tar \
`sed 's/[ ].*//' $(srcdir)/MANIFEST` `sed 's/[ ].*//' $(srcdir)/MANIFEST`