Generate .patchnum from .patch or .git
H.M. Brand [Tue, 23 Dec 2008 12:48:33 +0000 (13:48 +0100)]
MANIFEST
make_patchnum.sh

index f1a9719..3320f83 100644 (file)
--- 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
index 2746840..b06a4f3 100644 (file)
@@ -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