# HG changeset patch # User Oleksandr Gavenko # Date 1326651932 -7200 # Node ID 1bcce07aabf587a5f874962195f47f3aa9596ff6 # Parent 7c6fc5f0688402e4c983574248e4d5bf3a9dd9df# Parent ca6ceff4941c525c32769dfb1b5746c85048d538 merged diff -r 7c6fc5f06884 -r 1bcce07aabf5 .hgignore --- a/.hgignore Sun Jan 15 20:25:15 2012 +0200 +++ b/.hgignore Sun Jan 15 20:25:32 2012 +0200 @@ -1,6 +1,7 @@ syntax: glob VERSION* +STAT.rst *.dict *.dict.dz *.index diff -r 7c6fc5f06884 -r 1bcce07aabf5 CHANGES.rst --- a/CHANGES.rst Sun Jan 15 20:25:15 2012 +0200 +++ b/CHANGES.rst Sun Jan 15 20:25:32 2012 +0200 @@ -9,6 +9,11 @@ .. include:: VERSION.rst +tag:t0.2, 2012-01-xx. +===================== + + * Add target for checks of release sanity. + tag:t0.1, 2012-01-12. ===================== diff -r 7c6fc5f06884 -r 1bcce07aabf5 Makefile --- a/Makefile Sun Jan 15 20:25:15 2012 +0200 +++ b/Makefile Sun Jan 15 20:25:32 2012 +0200 @@ -54,12 +54,25 @@ -include VERSION VERSION: - ver=$$(hg log -r . --template '{latesttag}'); \ -ver=$${ver#t}; \ -major=$${ver%.*}; \ -minor=$${ver#*.}; \ -printf "vmajor=%s\nvminor=%s\n" $$major $$minor >VERSION - # is_release=`hg log --template '{latesttagdistance}'` + \ +vtagdist=$$(hg log -r . --template '{latesttagdistance}'); \ +vatrelease=$$([ $$vtagdist = 0 ] && echo yes || echo no); \ +vtag=$$(hg log -r . --template '{latesttag}'); \ +vmajor=$${vtag#t}; \ +vmajor=$${vmajor%.*}; \ +vminor=$${vtag#*.}; \ +vrev=$$(hg id -i); \ +visclean=$$(case $$vrev in *+) echo no;; *) echo yes;; esac); \ +vrev=$${vrev%+}; \ +{ \ +echo "vrev=$$vrev"; \ +echo "vtag=$$vtag"; \ +echo "vtagdist=$$vtagdist"; \ +echo "visclean=$$visclean"; \ +echo "vatrelease=$$vatrelease"; \ +echo "vmajor=$$vmajor"; \ +echo "vminor=$$vminor"; \ +} >VERSION ################################################################ # Determine platform/environment. @@ -151,7 +164,7 @@ # Will be accessed via http://$(pkgname).sourceforge.net .PHONY: deploy2sf-doc -deploy2sf-doc: $(HTML_FILES) +deploy2sf-doc: deploy-check $(HTML_FILES) ( echo 'cd htdocs'; \ for f in $(HTML_FILES); do \ echo "put $$f"; \ @@ -161,7 +174,7 @@ ) | sftp -b - $(SF_USER),$(pkgname)@web.sourceforge.net .PHONY: deploy2sf-release -deploy2sf-release: $(DIST_TARBALLS) $(DISTSRC_TARBALLS) +deploy2sf-release: deploy-check $(DIST_TARBALLS) $(DISTSRC_TARBALLS) ( echo 'cd /home/frs/project/g/ga/gadict'; \ echo "put CHANGES.rst"; \ echo "chmod 644 CHANGES.rst"; \ @@ -180,6 +193,17 @@ deploy2sf-src: hg push ssh://gavenkoa@hg.code.sf.net/p/$(pkgname)/code +.PHONY: deploy-check +deploy-check: + case ${visclean} in \ + no) echo "Local changes found. Build stop."; \ + exit 1;; \ + esac + case $(vatrelease) in \ + no) echo "We are not at release. Build stop."; \ + exit 1;; \ + esac + ################################################################ # Dist targets. @@ -256,9 +280,19 @@ VERSION.rst: VERSION $(BUILD_SCRIPT) { \ - echo 'Version: '$(vmajor).$(vminor); \ + echo 'For ``$(pkgname)`` version: ``$(vmajor).$(vminor)``.'; \ + echo; \ + case ${visclean} in \ + yes) echo 'Source files are at revision: ``$(vrev)``.';; \ + no) echo 'Some source files was modified from revision: ``$(vrev)``.';; \ + esac; \ echo; \ - echo 'Date: '`date +%F`; \ + case ${vatrelease} in \ + yes) echo 'Package is at release state.';; \ + no) echo 'Package is far from release state by $(vtagdist) changes.';; \ + esac; \ + echo; \ + echo 'Build date: ``'$$(date +%F)'``.'; \ } >$@ ################################################################ @@ -266,22 +300,48 @@ .PHONY: help help: - @echo - @echo vmajor=$(vmajor) - @echo vminor=$(vminor) - @echo - @echo Supported targets: - @sed -n -e '/^[[:alnum:]_-]*:/{s=^\(.*\):.*= \1=;p;}' $(BUILD_SCRIPT) + @\ +echo; \ +echo Current configuration:; \ +echo; \ +sed 's=^= =' $@ ################################################################ # Clean targets. @@ -292,7 +352,7 @@ .PHONY: clean clean: - rm -f $(DICTDZ_FILES) $(INDEX_FILES) $(HTML_FILES) + rm -f $(DICTDZ_FILES) $(INDEX_FILES) $(HTML_FILES) STAT.rst rm -rf $(DIST_DIR) $(DIST_TARBALLS) rm -rf $(DISTSRC_DIR) $(DISTSRC_TARBALLS)