Fix pre-compilation of mako templates. rpm-1.0-6
authorRyan Kelly <rfkelly@mozilla.com>
Mon, 14 Jan 2013 13:03:22 +1100
changeset 538 49c01f295908
parent 537 e72bcc4d1dce
child 539 a671be787ef9
push id119
push userrkelly@mozilla.com
push date2013-01-14 02:12 +0000
Fix pre-compilation of mako templates.
Makefile
--- a/Makefile
+++ b/Makefile
@@ -40,19 +40,21 @@ all:	build
 
 build:
 	$(VIRTUALENV) --distribute --no-site-packages .
 	$(INSTALL) Distribute
 	$(INSTALL) MoPyTools
 	$(INSTALL) Nose
 	$(INSTALL) WebTest
 	$(BUILDAPP) -c $(CHANNEL) $(PYPIOPTIONS) $(DEPS)
-	for TMPL in `find . -name '*.mako'`; do $(PYTHON) -c "from mako.template import Template; Template(filename='$$TMPL', module_directory='.')"; done;
+	# Pre-compile mako templates into the correct directories.
+	for TMPL in `find . -name '*.mako'`; do ./bin/python -c "from mako.template import Template; Template(filename='$$TMPL', module_directory='`dirname $$TMPL`', uri='`basename $$TMPL`')"; done;
 
 update:
 	$(BUILDAPP) -c $(CHANNEL) $(PYPIOPTIONS) $(DEPS)
-	for TMPL in `find . -name '*.mako'`; do $(PYTHON) -c "from mako.template import Template; Template(filename='$$TMPL', module_directory='.')"; done;
+	# Pre-compile mako templates into the correct directories.
+	for TMPL in `find . -name '*.mako'`; do ./bin/python -c "from mako.template import Template; Template(filename='$$TMPL', module_directory='`dirname $$TMPL`', uri='`basename $$TMPL`')"; done;
 
 test:
 	$(NOSE) $(TESTS)
 
 build_rpms:
 	$(BUILDRPMS) -c $(CHANNEL) $(DEPS)