From: Amos Jeffries Date: Sat, 28 Feb 2009 13:38:11 +0000 (+1300) Subject: TestBed: Alter translation to work in more make targets X-Git-Tag: SQUID_3_2_0_1~1151 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ae98ac11ed3be6894ac41dbd3512b45b4acf0b3d;p=thirdparty%2Fsquid.git TestBed: Alter translation to work in more make targets This makes translation work in distcheck, uninstallcheck, and installcheck out-of-tree testing. Not just dist, all, and check. Also adds some clean failure for out-of-tree 'make all' translations. Automake seems to not have enough correct path info to perform translation when its run inside distcheck target. Re-add distcheck to Testbed requirements. TODO: verify through build slaves that its portable. --- diff --git a/errors/Makefile.am b/errors/Makefile.am index 6c2a8a5008..badede0d7f 100644 --- a/errors/Makefile.am +++ b/errors/Makefile.am @@ -82,15 +82,17 @@ install-data-local: uninstall-local: - @ for l in $(LANGUAGES); do \ - for f in $(srcdir)/$$l/ERR_*; do \ - rm -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \ + @ for l in $(LANGUAGES) templates; do \ + for f in $(top_srcdir)/errors/$$l/ERR_*; do \ + $(RM) $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \ done; \ done; \ - for l in $(TRANSLATIONS) templates; do \ - if test -d $(srcdir)/$$l; then \ - for f in $(srcdir)/$$l/ERR_*; do \ - rm -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \ + for l in $(TRANSLATIONS); do \ + if test -d $(srcdir)/errors/$$l; then \ + for f in $(srcdir)/errors/$$l/ERR_*; do \ + if test -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; then \ + $(RM) $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \ + fi; \ done; \ fi \ done; @@ -122,7 +124,7 @@ addlang: all fi \ fi -dist-hook: +dist-hook: translate for lang in $(LANGUAGES) templates; do \ if test -d $(srcdir)/$$lang ; then \ test -d $(distdir)/$$lang \ @@ -132,7 +134,6 @@ dist-hook: || exit 1; \ fi; \ done; \ - $(MAKE) translate; \ for lang in $(TRANSLATIONS); do \ if test -d $$lang ; then \ test -d $(distdir)/$$lang \ @@ -145,13 +146,17 @@ dist-hook: cp -p $(srcdir)/errorpage.css $(distdir)/errorpage.css translate: - @ if test "$(PO2HTML)" != "" && test "$(PO2HTML)" != "no" && test "$(PO2HTML)" != "off"; then \ + @if test -f $(top_srcdir)/errors/en.po; then \ + echo "Translation is not currently possible."; \ + exit 0; \ + fi; \ + if test "$(PO2HTML)" != "" && test "$(PO2HTML)" != "no" && test "$(PO2HTML)" != "off" && test -f $(top_srcdir)/errors/en.po; then \ for lang in $(TRANSLATIONS); do \ - test -d $$lang && rm -r $$lang; \ - mkdir $$lang; \ + test -d $(distdir)/$$lang && $(RM) -r $(distdir)/$$lang; \ + mkdir $(distdir)/$$lang; \ echo -n "Translate '$$lang' ..."; \ - for f in `ls -1 $(srcdir)/templates`; do \ - $(PO2HTML) --progress=none -i $(srcdir)/$$lang.po -t $(srcdir)/templates/$$f >$$lang/$$f || exit 1; \ + for f in `ls -1 $(top_srcdir)/errors/templates`; do \ + $(PO2HTML) --progress=none -i $(top_srcdir)/errors/$$lang.po -t $(top_srcdir)/errors/templates/$$f >$(distdir)/$$lang/$$f || exit 1; \ done; \ echo "done."; \ done; \ @@ -165,5 +170,4 @@ translate: echo "http://www.squid-cache.org/Versions/langpack/"; \ fi -all: - $(MAKE) translate +all: translate diff --git a/test-suite/buildtest.sh b/test-suite/buildtest.sh index 0f50130dde..79ff0b4822 100755 --- a/test-suite/buildtest.sh +++ b/test-suite/buildtest.sh @@ -39,7 +39,7 @@ fi # rm -f -r src/fs/aufs/.deps src/fs/diskd/.deps && $base/../configure --silent ${OPTS} 2>&1 && - make ${pjobs} check 2>&1 && + make ${pjobs} distcheck 2>&1 && make ${pjobs} 2>&1 # do not build any of the install's ...