From: H.M. Brand Date: Tue, 23 Dec 2008 12:48:33 +0000 (+0100) Subject: Generate .patchnum from .patch or .git X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=531a2f446e4c4ff48354dfe55b2d17a7719ab97c;p=p5sagit%2Fp5-mst-13.2.git Generate .patchnum from .patch or .git --- diff --git a/MANIFEST b/MANIFEST index f1a9719..3320f83 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3164,6 +3164,7 @@ makedepend.SH Precursor to makedepend makedir.SH Precursor to makedir Makefile.micro microperl Makefile Makefile.SH A script that generates Makefile +make_patchnum.sh Script to generate .patchnum file malloc.c A version of malloc you might not want malloc_ctl.h A version of malloc you might not want MANIFEST This list of files diff --git a/make_patchnum.sh b/make_patchnum.sh index 2746840..b06a4f3 100644 --- a/make_patchnum.sh +++ b/make_patchnum.sh @@ -3,13 +3,11 @@ Existing=`cat .patchnum 2>/dev/null` if [ -e ".patch" ]; then Current=`awk '{print $4}' .patch` -else +elif [ -d ".git" ]; then # we should do something better here Current=`git describe` Changed=`git diff-index --name-only HEAD` - if [ -n "$Changed" ]; then - Current="$Current-with-uncommitted-changes" - fi + [ -n "$Changed" ] && Current="$Current-with-uncommitted-changes" fi if [ "$Existing" != "$Current" ]; then