From: Amos Jeffries Date: Mon, 6 Jul 2009 03:06:13 +0000 (+1200) Subject: Fix error pages not installed. X-Git-Tag: SQUID_3_2_0_1~912 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8aaaa056ed1de5ec8ebf08ef12a8271d45fbcacd;p=thirdparty%2Fsquid.git Fix error pages not installed. Attempts to translate, and installs the error pages content if present. Both srcdir and builddir are scanned used since the file location varies depending on whether a source bundle or VCS is used to install. --- diff --git a/errors/Makefile.am b/errors/Makefile.am index 5b40087bc8..843f8ae2f1 100644 --- a/errors/Makefile.am +++ b/errors/Makefile.am @@ -5,23 +5,30 @@ errordir = $(datadir)/errors - ##dist-hook eveything DEFAULT_ERROR_DIR = $(errordir) DEFAULT_STYLESHEET = $(sysconfdir)/errorpage.css # List of automated translations possible: -TRANSLATIONS=`ls -1 $(top_srcdir)/errors/*.po | grep -o -E "[a-z\-]+\.po" | sed s/.po//` +TRANSLATIONPO=`ls -1 $(top_srcdir)/errors/*.po | grep -o -E "[a-z\-]+\.po" | sed s/.po//` +TRANSLATIONDIR=`ls -1 $(srcdir)/ $(builddir)/ | sed -e 's%$(srcdir)/%%' -e 's%$(builddir)/%%' -e 's%.po%%' ` -install-data-local: - for l in $(TRANSLATIONS) templates; do \ +install-data-local: translate + for l in $(TRANSLATIONDIR) ; do \ if test -d $(srcdir)/$$l; then \ $(mkinstalldirs) $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l && \ for f in $(srcdir)/$$l/ERR_*; do \ echo "$(INSTALL_DATA) $$f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l"; \ $(INSTALL_DATA) $$f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l; \ done; \ + fi ; \ + if test -d $(builddir)/$$l; then \ + $(mkinstalldirs) $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l && \ + for f in $(builddir)/$$l/ERR_*; do \ + echo "$(INSTALL_DATA) $$f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l"; \ + $(INSTALL_DATA) $$f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l; \ + done; \ fi \ done; \ $(INSTALL_DATA) $(srcdir)/errorpage.css $(DESTDIR)$(DEFAULT_STYLESHEET).default; \ @@ -35,9 +42,16 @@ install-data-local: uninstall-local: - for l in $(TRANSLATIONS); do \ - if test -d $(srcdir)/errors/$$l; then \ - for f in $(srcdir)/errors/$$l/ERR_*; do \ + for l in $(TRANSLATIONDIR) ; do \ + if test -d $(srcdir)/$$l; then \ + for f in $(srcdir)/$$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 ; \ + if test -d $(builddir)/$$l; then \ + for f in $(builddir)/$$l/ERR_*; do \ if test -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; then \ $(RM) $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \ fi; \ @@ -53,7 +67,7 @@ upgrade: install $(SHELL) $(srcdir)/alias-link.sh "$(LN)" "$(RM)" "$(DESTDIR)$(DEFAULT_ERROR_DIR)" "$(srcdir)/alias-upgrade" || exit 1 ; dist-hook: translate - for lang in $(TRANSLATIONS); do \ + for lang in $(TRANSLATIONPO) templates; do \ if test -d $$lang ; then \ test -d $(distdir)/$$lang \ || mkdir $(distdir)/$$lang \ @@ -72,7 +86,7 @@ translate: 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 \ + for lang in $(TRANSLATIONPO); do \ test -d $(top_builddir)/errors/$$lang && $(RM) -r $(top_builddir)/errors/$$lang; \ mkdir $(top_builddir)/errors/$$lang || exit 1; \ echo -n "Translate '$$lang' ..."; \