]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
TestBed: Alter translation to work in more make targets
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 28 Feb 2009 13:38:11 +0000 (02:38 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 28 Feb 2009 13:38:11 +0000 (02:38 +1300)
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.

errors/Makefile.am
test-suite/buildtest.sh

index 6c2a8a5008ee517b43447b27c620a5f75bc17f82..badede0d7f3e896484428c37568bdd531c62ba3c 100644 (file)
@@ -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
index 0f50130ddee07adca2db1565644c3558cb9defc3..79ff0b4822c7b94639fcd1b525c2d68266445c45 100755 (executable)
@@ -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 ...