From: Yves Orton Date: Sun, 21 Dec 2008 15:34:56 +0000 (+0100) Subject: make sure that the perl -v/-V output corresponds to the latest commit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8565263ab8a47cda76538c0286536f59c53e155f;p=p5sagit%2Fp5-mst-13.2.git make sure that the perl -v/-V output corresponds to the latest commit --- diff --git a/.gitignore b/.gitignore index 5a760a1..81f4486 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ +# ignore .patch from rsync, and any generated patch files from git-am *.patch +# ignore local .config files .config - +# ignore generated .patchnum file +.patchnum # files produced by './configure.gnu' on a Linux machine diff --git a/Makefile.SH b/Makefile.SH index 2a902c3..755e600 100644 --- a/Makefile.SH +++ b/Makefile.SH @@ -535,7 +535,12 @@ sperl$(OBJ_EXT): perl.c $(h) sperl.i: perl.c $(h) $(CCCMDSRC) -DIAMSUID -E perl.c > sperl.i -.PHONY: all translators utilities +.PHONY: all translators utilities make_patchnum + +make_patchnum: + sh $(shellflags) make_patchnum.sh + +perl$(OBJ_EXT): make_patchnum .patchnum translators: miniperl$(EXE_EXT) $(CONFIGPM) FORCE @echo " "; echo " Making x2p stuff"; cd x2p; $(LDLIBPTH) $(MAKE) all diff --git a/cflags.SH b/cflags.SH index 9e0494e..b11966b 100755 --- a/cflags.SH +++ b/cflags.SH @@ -354,12 +354,8 @@ case "$cc" in ;; esac -if test -d .git; then - ccflags="-DPERL_PATCHNUM=`git describe` $ccflags" -else - if test -f .patch; then - ccflags="-DPERL_PATCHNUM=`awk '{print $4}' .patch` $ccflags" - fi +if [ -f .patchnum -a -n "$(cat .patchnum)"]; then + ccflags="-DPERL_PATCHNUM=`cat .patchnum`" fi : Can we perhaps use $ansi2knr here diff --git a/make_patchnun.sh b/make_patchnun.sh new file mode 100644 index 0000000..2306fa8 --- /dev/null +++ b/make_patchnun.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +Existing=`cat .patchnum 2>/dev/null` +Current=`git describe` + +if [ "$Existing" != "$Current" ]; then + echo "Updating .patchnum" + echo $Current > .patchnum +else + echo "Reusing .patchnum" +fi