]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Force `cheetah` to always run under Python 2.7
authorOleg Broytman <phd@phdru.name>
Thu, 4 Jun 2020 20:24:48 +0000 (23:24 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 4 Jun 2020 20:24:48 +0000 (23:24 +0300)
Makefile
make-files

index 862279fa93403fcf52dfcc39d2b579ee0f8de67b..6cd9e82736246ed8d4bae6658d467ac2e229ee4d 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 
 %.py: %.tmpl
-       umask 022; cheetah compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup $< && compyle $@ && chmod +x $@
+       umask 022; python2.7 `which cheetah` compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup $< && compyle $@ && chmod +x $@
 
 %.html: %.tmpl
-       umask 022; PYTHONPATH=. PYTHONIOENCODING=koi8-r:replace cheetah fill --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup --stdout $< | iconv -c -f utf-8 -t koi8-r >$@
+       umask 022; PYTHONPATH=. PYTHONIOENCODING=koi8-r:replace python2.7 `which cheetah` fill --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup --stdout $< | iconv -c -f utf-8 -t koi8-r >$@
 
 
 .PHONY: fast
index ca1ac094b48f83a66dd7b1cdac9e7600370f0a41..a43d782cb4e162ced61786c4d8b33be2e9b3deb9 100755 (executable)
@@ -6,7 +6,7 @@ PYTHONIOENCODING=koi8-r:replace
 export PYTHONPATH PYTHONIOENCODING
 
 if [ \! -e phd_site.py -o phd_site.tmpl -nt phd_site.py ]; then
-   cheetah compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup phd_site.tmpl &&
+   python2.7 `which cheetah` compile --encoding=koi8-r --settings='encoding="koi8-r"' --nobackup phd_site.tmpl &&
    compyle phd_site.py
 fi &&
 
@@ -14,7 +14,7 @@ for tmpl in "$@"; do
    dir="`dirname \"$tmpl\"`"
    outfile="`basename \"$tmpl\" .tmpl`.html"
    echo "$tmpl => $dir/$outfile"
-   cheetah fill --encoding=koi8-r --settings='encoding="koi8-r"' \
+   python2.7 `which cheetah` fill --encoding=koi8-r --settings='encoding="koi8-r"' \
       --nobackup --stdout "$tmpl" | iconv -c -f utf-8 -t koi8-r >"$dir/$outfile" || exit 1
 done