zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: version.h and ChangeLog
Date: Mon, 8 Apr 2013 22:02:07 +0100	[thread overview]
Message-ID: <20130408220207.4c02af51@pws-pc.ntlworld.com> (raw)
In-Reply-To: <20130408203413.43e20021@pws-pc.ntlworld.com>

On Mon, 8 Apr 2013 20:34:13 +0100
Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> What should probably happen is that "make targz-src" should somehow
> freeze the contents of patchlevel.h so that making it when untarred
> doesn't update the header any further.

Here's one possible simple way of doing that, though it would be better
to move the code that generates the file contents into a script.

By the way, are we guaranteed that the output of 'git describe --tags
--long' is the same for everyone that has pulled the same code from the
server (and doesn't have local changes)?  If not, it would be worth a
bit of extra work to make it so: the whole point of the patchlevel is so
it consistently refers to a particular state of what's on the server for
reporting by users who are just tracking development.  Local changes are
really a special case here --- people developing the shell can be
assumed to be knowledgeable enough to make their own investigations ---
though if it's possible to indicate that there are changes not pushed to
the server in a way that sticks out, e.g. with something appended like
"-local-<ref>", that's useful, too.  This is definitely looking like a
script.

diff --git a/Makefile.in b/Makefile.in
index 5fb736f..a29ab78 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -160,6 +160,7 @@ targz-src: $(DISTNAME).tar.gz
 $(DISTNAME).tar.gz: FORCE
 	@$(sdir_top)/Util/mkdisttree.sh $(DISTNAME) $(sdir_top) $(dir_top) SRC \
 	    $(MAKE) $(MAKEDEFS)
+	echo '#define ZSH_PATCHLEVEL "'`git describe --tags --long`'"' >$(DISTNAME)/Src/patchlevel.h.release
 	tar cf - $(DISTNAME) | gzip -9 > $@
 	rm -rf $(DISTNAME)
 
diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index 420e8fc..0fec5c3 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -40,8 +40,12 @@ version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h
 	echo '#define ZSH_VERSION "'$(VERSION)'"' > $@
 
 patchlevel.h: FORCE
-	echo '#define ZSH_PATCHLEVEL "'`git describe --tags --long`'"' > $@.tmp
-	cmp $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@
+	@if [ -f $(sdir)/$@.release ]; then \
+	  cp -f $(sdir)/$@.release $@; \
+	else \
+	  echo '#define ZSH_PATCHLEVEL "'`git describe --tags --long`'"' > $@.tmp; \
+	  cmp $@ $@.tmp && rm -f $@.tmp || mv $@.tmp $@; \
+	fi
 FORCE:
 
 zshcurses.h: ../config.h

-- 
Peter Stephenson <p.w.stephenson@ntlworld.com>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/


  reply	other threads:[~2013-04-08 21:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-07 17:38 Bart Schaefer
2013-04-07 18:23 ` Peter Stephenson
2013-04-07 19:33   ` Bart Schaefer
2013-04-08 12:30   ` Frank Terbeck
2013-04-08 19:34     ` Peter Stephenson
2013-04-08 21:02       ` Peter Stephenson [this message]
2013-04-09 16:47         ` Simon Ruderich
2013-04-09 20:18           ` Phil Pennock
2013-04-10  0:23             ` Simon Ruderich

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

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

  git send-email \
    --in-reply-to=20130408220207.4c02af51@pws-pc.ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.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://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).