From 3ec604bb8338261fad4167a4ebd331d371d01034 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Thu, 26 May 2016 00:04:32 +0300 Subject: [PATCH] [PATCH 3/3] Makefile.local: use $(wildcard) to check existence of ${srcdir}/.git --- 6a/bedeb004da67e700018a0f35723fb302b72138 | 71 +++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 6a/bedeb004da67e700018a0f35723fb302b72138 diff --git a/6a/bedeb004da67e700018a0f35723fb302b72138 b/6a/bedeb004da67e700018a0f35723fb302b72138 new file mode 100644 index 000000000..197e464d3 --- /dev/null +++ b/6a/bedeb004da67e700018a0f35723fb302b72138 @@ -0,0 +1,71 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id C9FAD6DE0222 + for ; Wed, 25 May 2016 14:04:49 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.258 +X-Spam-Level: +X-Spam-Status: No, score=0.258 tagged_above=-999 required=5 tests=[AWL=0.267, + HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 3JO2wJfc0fbx for ; + Wed, 25 May 2016 14:04:41 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id D4A216DE0217 + for ; Wed, 25 May 2016 14:04:40 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 899D71000E0; Thu, 26 May 2016 00:04:35 +0300 (EEST) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Cc: tomi.ollila@iki.fi +Subject: [PATCH 3/3] Makefile.local: use $(wildcard) to check existence of + ${srcdir}/.git +Date: Thu, 26 May 2016 00:04:32 +0300 +Message-Id: <1464210272-26281-3-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 2.8.2 +In-Reply-To: <1464210272-26281-1-git-send-email-tomi.ollila@iki.fi> +References: <1464210272-26281-1-git-send-email-tomi.ollila@iki.fi> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.20 +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: Wed, 25 May 2016 21:04:49 -0000 + +With this GNU Make construct one shell invocation can be skipped +and code looks shorter (narrower). This would now match to .git +being other file type than regular file or directory (or symlink +to those), but that is not a use case anyone should expect users +to do. +--- + Makefile.local | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile.local b/Makefile.local +index ee3cf18f5757..045549b54442 100644 +--- a/Makefile.local ++++ b/Makefile.local +@@ -10,7 +10,7 @@ + # repository), we let git append identification of the actual commit. + PACKAGE=notmuch + +-IS_GIT:=$(shell if [ -d ${srcdir}/.git -o -f ${srcdir}/.git ] ; then echo yes ; else echo no; fi) ++IS_GIT:=$(if $(wildcard ${srcdir}/.git),yes,no) + + ifeq ($(IS_GIT),yes) + DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd) +-- +2.8.2 + -- 2.26.2