unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: [PATCH] build-system: use a shell variable for TMPFILE in debian-snapshot
Date: Sat, 17 Dec 2011 23:16:51 -0400	[thread overview]
Message-ID: <1324178211-30739-1-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1324136185-4509-1-git-send-email-aaronecay@gmail.com>

From: David Bremner <bremner@debian.org>

Aaron Ecay points out in
id:"1324136185-4509-1-git-send-email-aaronecay@gmail.com" that the
mktemp in

     debian-snapshot: TMPFILE := $(shell mktemp)

Is being evaluated for every target. As best I can tell, this is
because make is evaluating the right hand side, even though it is not
doing the assignment.

Of course, it isn't quite as nice to edit with the line continuations,
but it is ideomatic make.
---
 Makefile.local |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/Makefile.local b/Makefile.local
index 5108a0c..97f397f 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -139,15 +139,16 @@ pre-release:
 	mv $(TAR_FILE) $(DEB_TAR_FILE) releases
 
 .PHONY: debian-snapshot
-debian-snapshot: TMPFILE := $(shell mktemp)
 debian-snapshot:
 	make VERSION=$(VERSION) clean
-	cp debian/changelog $(TMPFILE)
-	EDITOR=/bin/true dch -b -v $(VERSION)+1 -D UNRELEASED 'test build, not for upload'
-	echo '3.0 (native)' > debian/source/format
-	debuild -us -uc
-	mv -f $(TMPFILE) debian/changelog
-	echo '3.0 (quilt)' > debian/source/format
+	TMPFILE=$$(mktemp /tmp/notmuch.XXXXXX);		\
+	  cp debian/changelog $${TMPFILE};		\
+	  EDITOR=/bin/true dch -b -v $(VERSION)+1	\
+	    -D UNRELEASED 'test build, not for upload';	\
+	  echo '3.0 (native)' > debian/source/format; 	\
+	  debuild -us -uc;				\
+	  mv -f $${TMPFILE} debian/changelog;		\
+	  echo '3.0 (quilt)' > debian/source/format
 
 .PHONY: release-message
 release-message:
-- 
1.7.7.3

  parent reply	other threads:[~2011-12-18  3:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-17 15:36 [PATCH] Give a path name to mktemp in Makefile.local Aaron Ecay
2011-12-17 19:55 ` Tomi Ollila
2011-12-17 21:20 ` Jameson Graef Rollins
2011-12-17 23:21   ` Aaron Ecay
2011-12-18  3:16 ` David Bremner [this message]
2011-12-18  8:48   ` [PATCH] build-system: use a shell variable for TMPFILE in debian-snapshot Tomi Ollila
2011-12-18 10:46     ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324178211-30739-1-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=bremner@debian.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).