diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2008-11-26 10:42:48 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2008-11-26 10:42:48 (GMT) |
commit | 9bcfa9cdede27be34d11f42dfae3d8fd60fc92bc (patch) | |
tree | 77f11fd6fb26c9ac4d8a410983629927c70d5319 /NP-VERSION-GEN | |
parent | ed9a088b37dcb8ba56d397592f4e8230a6a011e5 (diff) | |
download | monitoring-plugins-9bcfa9cdede27be34d11f42dfae3d8fd60fc92bc.tar.gz |
Disable dynamic versionning for releases, and allow generating version out of subversion.
This should be a definitive fix for systems with non-compilant make programs as the version will be taken from $(PACKAGE_VERSION) instead.
At the same time I added code for generating svn-based version strings.
Diffstat (limited to 'NP-VERSION-GEN')
-rwxr-xr-x | NP-VERSION-GEN | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN index 1169710..f963e63 100755 --- a/NP-VERSION-GEN +++ b/NP-VERSION-GEN | |||
@@ -11,12 +11,8 @@ DEF_VER=1.4.13.git | |||
11 | LF=' | 11 | LF=' |
12 | ' | 12 | ' |
13 | 13 | ||
14 | # First see if there is a version file (included in release tarballs), | 14 | # First try git-describe, then svn info, then default. |
15 | # then try git-describe, then default. | 15 | if test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git && |
16 | if test -f $SRC_ROOT/version | ||
17 | then | ||
18 | VN=`cat $SRC_ROOT/version` || VN="$DEF_VER" | ||
19 | elif test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git && | ||
20 | VN=`cd $SRC_ROOT; git describe --abbrev=4 HEAD 2>/dev/null` && | 16 | VN=`cd $SRC_ROOT; git describe --abbrev=4 HEAD 2>/dev/null` && |
21 | case "$VN" in | 17 | case "$VN" in |
22 | *$LF*) (exit 1) ;; | 18 | *$LF*) (exit 1) ;; |
@@ -27,6 +23,17 @@ elif test -d $SRC_ROOT/.git -o -f $SRC_ROOT/.git && | |||
27 | esac | 23 | esac |
28 | then | 24 | then |
29 | VN=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`; | 25 | VN=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`; |
26 | elif test -d $SRC_ROOT/.svn -o -f $SRC_ROOT/.svn && | ||
27 | VN=`cd $SRC_ROOT; svn info 2>/dev/null | grep '^Revision'` && | ||
28 | case "$VN" in | ||
29 | *$LF*) (exit 1) ;; | ||
30 | Revision:*) | ||
31 | VN=`echo $VN | awk '{print $NF}'` | ||
32 | test "`svn status 2>/dev/null | grep '^[AMD]' | wc -l`" = 0 || | ||
33 | VN="$VN-dirty" ;; | ||
34 | esac | ||
35 | then | ||
36 | VN=`echo "trunk.$VN" | sed -e 's/-/./g'`; | ||
30 | else | 37 | else |
31 | VN="$DEF_VER" | 38 | VN="$DEF_VER" |
32 | fi | 39 | fi |