make release: Provide a kinder message when VERSION is forgotten.

I'm unlikely to always remember to pass VERSION=X.Y so it's nice for
make release to remind me.
This commit is contained in:
Carl Worth 2010-04-15 18:40:08 -07:00
parent 2bf06e177d
commit 2475afcf0d

View file

@ -9,7 +9,7 @@
# Between releases, (such as when compiling notmuch from the git # Between releases, (such as when compiling notmuch from the git
# repository), we let git append identification of the actual commit. # repository), we let git append identification of the actual commit.
PACKAGE=notmuch PACKAGE=notmuch
VERSION:=$(shell if [ -f version ]; then cat version; else git describe --match '[0-9].[0-9]*'; fi) VERSION:=$(shell if [ -f version ]; then cat version; else git describe --match '[0-9.]*'; fi)
RELEASE_HOST=notmuchmail.org RELEASE_HOST=notmuchmail.org
RELEASE_DIR=/srv/notmuchmail.org/www/releases RELEASE_DIR=/srv/notmuchmail.org/www/releases
@ -119,10 +119,14 @@ release-message:
.PHONY: verify-version .PHONY: verify-version
verify-version: verify-version:
@echo -n "Checking that $(VERSION) is a two-component version..." @echo -n "Checking that $(VERSION) consists only of digits and periods..."
@if echo $(VERSION) | grep -q -v -x '[0-9]*\.[0-9]*'; then \ @if echo $(VERSION) | grep -q -v -x '[0-9.]*'; then \
(echo "Ouch." && \ (echo "No." && \
echo "Before releasing the notmuch version should be a two-component value." && false);\ echo "Remember: You need to use:" && \
echo "" && \
echo " make VERSION=X.Y release" && \
echo "" && \
echo "to release notmuch." && false); \
else :; fi else :; fi
@echo "Good." @echo "Good."