]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Fix [ -nt ]-test for /bin/sh
authorOleg Broytman <phd@phdru.name>
Sun, 9 Apr 2017 01:07:22 +0000 (04:07 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 10 Apr 2017 03:26:36 +0000 (06:26 +0300)
Tests in sh and bash behave differently:
test in sh reports false if the file doesn't exist,
test in bash reports true if the file doesn't exist.

make-files

index 31a7b651335913ead0cbe26beb78172e514de7fd..5c736eaab2ee41b82d45b6d96c48727b2ebf3857 100755 (executable)
@@ -5,7 +5,7 @@ PYTHONPATH=.
 PYTHONIOENCODING=koi8-r:replace
 export PYTHONPATH PYTHONIOENCODING
 
-if [ phd_site.tmpl -nt phd_site.py ]; then
+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 &&
    compyle phd_site.py
 fi &&