zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: dependency of patchlevel.h
@ 2018-08-31 14:35 Oliver Kiddle
  0 siblings, 0 replies; only message in thread
From: Oliver Kiddle @ 2018-08-31 14:35 UTC (permalink / raw)
  To: Zsh workers

In my own builds, I've been finding that make install needs to recompile
a few files and that $ZSH_PATCHLEVEL is generally empty. After looking
into the cause, it seems to be rather specific to my setup but I include
a patch, nevertheless.

In the Makefile, we force building patchlevel.h but use cmp to ensure it
is only updated when changed. But make install is normally run as root
and on my system, root is using an older version of git.

The older git outputs a 7 hex-digit hash while more recent git adapts it
based on the number of objects in the repository so I get 9 hex-digits.

By adding --abbrev=7, we can ensure consistency. Perhaps we should use a
bigger value than 7 - any thoughts on that? Currently, there are no
duplicates in the first 7 digits for the zsh repository.

Also, is there any objection to adding -f to the mv command. Running
make install as root tends to result in patchlevel.h being owned by root
and then the mv needs to prompt before overwriting it. 

Oliver

diff --git a/Src/zsh.mdd b/Src/zsh.mdd
index 324435d62..3e5788af5 100644
--- a/Src/zsh.mdd
+++ b/Src/zsh.mdd
@@ -53,8 +53,8 @@ patchlevel.h: FORCE
 	@if [ -f $(sdir)/$@.release ]; then \
 	  cp -f $(sdir)/$@.release $@; \
 	else \
-	  echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags --long`'"' > $@.tmp; \
-	  cmp $@ $@.tmp >/dev/null 2>&1 && rm -f $@.tmp || mv $@.tmp $@; \
+	  echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags --long --abbrev=7`'"' > $@.tmp; \
+	  cmp $@ $@.tmp >/dev/null 2>&1 && rm -f $@.tmp || mv -f $@.tmp $@; \
 	fi
 FORCE:
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-08-31 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 14:35 PATCH: dependency of patchlevel.h Oliver Kiddle

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).