Warn if build done without version file.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 01 Jun 2016 14:58:41 +0300
changeset 482 fefea56726d2
parent 481 f2b8c358716d
child 483 370ed8138f62
Warn if build done without version file.
.hgignore
Makefile
--- a/.hgignore	Wed Jun 01 14:48:20 2016 +0300
+++ b/.hgignore	Wed Jun 01 14:58:41 2016 +0300
@@ -1,18 +1,7 @@
 syntax: glob
 
 dist/
-
-*.dict
-*.dict.dz
-*.index
-*.html
-voa-special.aux
-voa-special.log
-voa-special.out
-voa-special.pdf
-*.tar.gz
-*.tar.bz2
-gadict-*.*/**
+VERSION
 
 .devel/
 *~
--- a/Makefile	Wed Jun 01 14:48:20 2016 +0300
+++ b/Makefile	Wed Jun 01 14:58:41 2016 +0300
@@ -57,6 +57,7 @@
 
 $(VER_FILE): | $(dir $(VER_FILE))
 	\
+[ -d .hg/ ] || { echo We miss VERSION file!!; exit 0; }; \
 vtagdist=$$(hg log -r . --template '{latesttagdistance}'); \
 vatrelease=$$([ $$vtagdist -le 1 ] && echo yes || echo no); \
 vtag=$$(hg log -r . --template '{latesttag}'); \
@@ -426,8 +427,9 @@
 
 $(RST_TMPL_FILE): www/tmpl/rst.tmpl.in $(BUILD_SCRIPTS) | $(dir $(RST_TMPL_FILE))
 	\
-[[ ${visclean} = no ]] && warn1='<b>Warning</b>: Build done with local changes!' || :; \
-[[ ${vatrelease} = no ]] && warn2='<b>Warning</b>: Build is far from latest <tt>$(vtag)</tt> release state by $(vtagdist) changes.' || :; \
+[[ "${visclean}" = no ]] && warn1='<b>Warning</b>: Build done with local changes!' || :; \
+[[ -z "${visclean}" ]] && warn1='<b>Warning</b>: Build done without <b>VERSION</b> file!' || :; \
+[[ "${vatrelease}" = no ]] && warn2='<b>Warning</b>: Build is far from latest <tt>$(vtag)</tt> release state by $(vtagdist) changes.' || :; \
 sed -e "s|{date}|$$(date +%F)|" -e "s|{rev}|$$(hg id -i)|" -e "s|{warn1}|$$warn1|" -e "s|{warn2}|$$warn2|" <$< >$@
 
 ################################################################