Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id DA244429E2F for ; Thu, 17 Nov 2011 18:26:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hFD2fcUfDA9X for ; Thu, 17 Nov 2011 18:26:46 -0800 (PST) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 1FBE1429E27 for ; Thu, 17 Nov 2011 18:26:46 -0800 (PST) Received: from zancas.localnet (fctnnbsc36w-156034074106.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.74.106]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pAI2QdjX028543 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 17 Nov 2011 22:26:42 -0400 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1RREA2-0005GB-Tl; Thu, 17 Nov 2011 22:26:38 -0400 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 2/3] build system: add target update-versions to propagate version Date: Thu, 17 Nov 2011 22:26:25 -0400 Message-Id: <1321583186-20187-2-git-send-email-david@tethera.net> X-Mailer: git-send-email 1.7.7.1 In-Reply-To: <1321583186-20187-1-git-send-email-david@tethera.net> References: <87y5vtm3as.fsf@nikula.org> <1321583186-20187-1-git-send-email-david@tethera.net> Cc: David Bremner X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 02:26:47 -0000 From: David Bremner The version from file "version" is propagated to the man page and the python bindings via sed. Note that the git version is ignored because of the check for MAKECMDGOALS. --- Makefile.local | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/Makefile.local b/Makefile.local index 10e6668..775f393 100644 --- a/Makefile.local +++ b/Makefile.local @@ -12,8 +12,14 @@ PACKAGE=notmuch IS_GIT=$(shell if [ -d .git ] ; then echo yes ; else echo no; fi) +ifeq ($(IS_GIT),yes) +DATE:=$(shell git log --date=short -1 --pretty=format:%cd) +else +DATE:=$(shell date +%F) +endif + VERSION:=$(shell cat ${srcdir}/version) -ifeq ($filter release release-message pre-release,$(MAKECMDGOALS),) +ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),) ifeq ($(IS_GIT),yes) VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/) endif @@ -87,6 +93,12 @@ $(GPG_FILE): $(SHA1_FILE) .PHONY: dist dist: $(TAR_FILE) +.PHONY: update-versions + +update-versions: + sed -i "s/^.TH NOTMUCH 1.*$$/.TH NOTMUCH 1 ${DATE} \"Notmuch ${VERSION}\"/" notmuch.1 + sed -i "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" $(PV_FILE) + # We invoke make recursively only to force ordering of our phony # targets in the case of parallel invocation of make (-j). # -- 1.7.7.1