diff options
author | Yves Orton <demerphq@dromedary.booking.com> | 2008-12-26 17:12:22 +0100 |
---|---|---|
committer | Yves Orton <demerphq@dromedary.booking.com> | 2008-12-27 11:18:09 +0100 |
commit | 6abfca009fc00780b1546304f40b7d5b81f3cb76 (patch) | |
tree | 23c6c6f92b5b1657e5aa39851771caf937286446 /make_patchnum.sh | |
parent | 4f68271caaab1f350ae812cccb5d90806ab15b75 (diff) | |
download | perl-6abfca009fc00780b1546304f40b7d5b81f3cb76.tar.gz |
better git based version numbering (hopefully sane)
Diffstat (limited to 'make_patchnum.sh')
-rw-r--r-- | make_patchnum.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/make_patchnum.sh b/make_patchnum.sh index 5a6163702d..b26217ffa8 100644 --- a/make_patchnum.sh +++ b/make_patchnum.sh @@ -1,18 +1,22 @@ #!/bin/sh Existing=`cat .patchnum 2>/dev/null` +Existing_Sha1=`cat .sha1 2>/dev/null` if [ -e ".patch" ]; then Current=`awk '{print $4}' .patch` + Sha1=`awk '{print $3}' .patch` elif [ -d ".git" ]; then # we should do something better here Current=`git describe` + Sha1=`git rev-parse HEAD` Changed=`git diff-index --name-only HEAD` [ -n "$Changed" ] && Current="$Current-with-uncommitted-changes" fi -if [ "$Existing" != "$Current" ]; then - echo "Updating .patchnum" +if [ "$Existing" != "$Current" -o "$Existing_Sha1" != "$Sha1" ]; then + echo "Updating .patchnum and .sha1" echo -n $Current > .patchnum + echo -n $Sha1 > .sha1 else - echo "Reusing .patchnum" + echo "Reusing .patchnum and .sha1" fi |