[beast] PO: distcheck: ensure 'update-po' has been run to ship updated .po files



commit 39244086519fcef52aa01f3cb405bc7f7719d354
Author: Tim Janik <timj gnu org>
Date:   Fri Apr 1 21:51:07 2016 +0200

    PO: distcheck: ensure 'update-po' has been run to ship updated .po files
    
    Signed-off-by: Tim Janik <timj gnu org>

 Makefile.am    |    6 ++++--
 po/Makefile.am |   19 +++++++++++++++----
 2 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 54bf30e..9ec48ba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -48,11 +48,13 @@ installcheck-local: bse-app-test
 
 
 # == distcheck-checks ==
-DISTCHECK_HOOK = distcheck # help add dependencies to 'distcheck' without overriding its definition
-$(DISTCHECK_HOOK): distcheck-check-xz-opt
 distcheck-check-xz-opt:
        $(Q) test "$$XZ_OPT" != '--fast' -a "$$XZ_OPT" != '-0' || \
        { echo "distcheck: error: bad compression option for distribution tarball: XZ_OPT=$$XZ_OPT" >&2 ; 
exit 1 ; }
+check-update-po:
+       $(Q) $(MAKE) -C po check-update-po
+DISTCHECK_HOOK = distcheck # help add dependencies to 'distcheck' without overriding its definition
+$(DISTCHECK_HOOK): distcheck-check-xz-opt check-update-po
 
 # == Dist Fixes ==
 # Some files remain after distcheck, that we cannot clean up. So we role our own listfiles filter.
diff --git a/po/Makefile.am b/po/Makefile.am
index dfba702..98c3467 100644
--- a/po/Makefile.am
+++ b/po/Makefile.am
@@ -169,13 +169,24 @@ update-po: Makefile
          $(GMSGFMT) -o /dev/null --verbose $(srcdir)/$$i ; \
        done
 .PHONY: update-po
-DISTDIR_HOOK = distdir # use indirection to emulate distdir-hook
-$(DISTDIR_HOOK): $(shell test w == `stat -c '%A' $(srcdir)/messages.pot | cut -c3` && echo 'update-po') # 
using 'test -w' fails for UID=0
+check-update-po: Makefile $(srcdir)/messages.pot
+       $(Q) rm -f check-messages.pot # force rebuild
+       $(Q) $(MAKE) --no-print-directory check-messages.pot
+       @echo -n "Checking for updated po files: "
+       $(Q) for i in $(POFILES) ; do \
+         echo -n '.' ; \
+         cp $(srcdir)/$$i xtmp-$$i && $(MSGMERGE) -qsU --backup=none xtmp-$$i check-messages.pot || exit ; \
+         cmp -s $(srcdir)/$$i xtmp-$$i || \
+         { echo ; echo "$$i: error: message updates missing, run 'update-po' first" >&2 ; exit 1 ; } ; \
+         rm -f xtmp-$$i ; \
+       done ; echo
+       $(Q) rm -f check-messages.pot
+.PHONY: check-update-po
 
 CLEANFILES += $(POTLIST) $(TMPLIST) $(TMPDIR)/
 
-$(srcdir)/messages.pot: POTSCAN
-       @echo "Rebuilding $(@F)..."
+$(srcdir)/messages.pot check-messages.pot: POTSCAN
+       @echo "Building $(@F)..."
        @rm -f $(POTLIST) $(TMPLIST) ; rm -rf $(TMPDIR)/
        @sed -e '/^#/d' -e 's/^\[[^:]*:[^]]*][[:space:]]*//' -e '/^[[:space:]]*$$/d' < POTSCAN > $(POTLIST) \
        && cp $(POTLIST) $(TMPLIST) && mkdir -p $(TMPDIR)/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]