1 Return-Path: <too@guru-group.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 3582B431FC2
\r
6 for <notmuch@notmuchmail.org>; Tue, 6 May 2014 12:35:40 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 8Q193bFxweqs for <notmuch@notmuchmail.org>;
\r
16 Tue, 6 May 2014 12:35:35 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id 5C104431FAF
\r
19 for <notmuch@notmuchmail.org>; Tue, 6 May 2014 12:35:35 -0700 (PDT)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id DFDFA1000F2; Tue, 6 May 2014 22:35:30 +0300 (EEST)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH] build: check .git directory existence in srcdir (for
\r
26 Date: Tue, 6 May 2014 22:35:28 +0300
\r
27 Message-Id: <1399404928-15471-1-git-send-email-tomi.ollila@iki.fi>
\r
28 X-Mailer: git-send-email 1.8.0
\r
29 Cc: tomi.ollila@iki.fi
\r
30 X-BeenThere: notmuch@notmuchmail.org
\r
31 X-Mailman-Version: 2.1.13
\r
33 List-Id: "Use and development of the notmuch mail system."
\r
34 <notmuch.notmuchmail.org>
\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
36 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
38 List-Post: <mailto:notmuch@notmuchmail.org>
\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
42 X-List-Received-Date: Tue, 06 May 2014 19:35:40 -0000
\r
44 So that $(VERSION) and version.stamp uses the git-describe -based
\r
45 version data instead of the content of `version' file.
\r
47 For consistency also the git commands in Makefile[.local] target
\r
48 `verify-no-dirty-code' uses the git --git-dir=$srcdir/.git ...
\r
49 commands (inside ifeq($(IS_GIT),yes)). Attempting to make this
\r
50 target outside of the tree will fail in any case.
\r
52 Makefile.local | 10 +++++-----
\r
53 1 file changed, 5 insertions(+), 5 deletions(-)
\r
55 diff --git a/Makefile.local b/Makefile.local
\r
56 index f0c4453574b8..a9a6df8bf0e0 100644
\r
57 --- a/Makefile.local
\r
58 +++ b/Makefile.local
\r
60 # repository), we let git append identification of the actual commit.
\r
63 -IS_GIT=$(shell if [ -d .git ] ; then echo yes ; else echo no; fi)
\r
64 +IS_GIT=$(shell if [ -d ${srcdir}/.git ] ; then echo yes ; else echo no; fi)
\r
66 ifeq ($(IS_GIT),yes)
\r
67 -DATE:=$(shell git log --date=short -1 --pretty=format:%cd)
\r
68 +DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd)
\r
70 DATE:=$(shell date +%F)
\r
72 @@ -21,7 +21,7 @@ endif
\r
73 VERSION:=$(shell cat ${srcdir}/version)
\r
74 ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
\r
75 ifeq ($(IS_GIT),yes)
\r
76 -VERSION:=$(shell git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
\r
77 +VERSION:=$(shell git --git-dir=${srcdir}/.git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
\r
78 # Write the file 'version.stamp' in case its contents differ from $(VERSION)
\r
79 FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)
\r
80 ifneq ($(FILE_VERSION),$(VERSION))
\r
81 @@ -200,11 +200,11 @@ verify-source-tree-and-version: verify-no-dirty-code
\r
82 verify-no-dirty-code: release-checks
\r
83 ifeq ($(IS_GIT),yes)
\r
84 @printf "Checking that source tree is clean..."
\r
85 -ifneq ($(shell git ls-files -m),)
\r
86 +ifneq ($(shell git --git-dir=${srcdir}/.git ls-files -m),)
\r
88 @echo "The following files have been modified since the most recent git commit:"
\r
91 + @git --git-dir=${srcdir}/.git ls-files -m
\r
93 @echo "The release will be made from the committed state, but perhaps you meant"
\r
94 @echo "to commit this code first? Please clean this up to make it more clear."
\r