make git-describe info show up in -V output in the "Characteristics of this binary...
[p5sagit/p5-mst-13.2.git] / make_patchnum.sh
1 #!/bin/sh
2
3 Existing=`cat .patchnum 2>/dev/null`
4 if [ -e ".patch" ]; then
5         Current=`awk '{print $4}' .patch`
6 elif [ -d ".git" ]; then
7         # we should do something better here
8         Current=`git describe`
9         Changed=`git diff-index --name-only HEAD`
10         [ -n "$Changed" ] && Current="$Current-with-uncommitted-changes"
11 fi
12
13 if [ "$Existing" != "$Current" ]; then
14         echo "Updating .patchnum"
15         echo -n $Current > .patchnum
16 else
17         echo "Reusing .patchnum" 
18 fi