diff options
author | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-23 05:38:47 +0000 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@users.sourceforge.net> | 2008-11-23 05:38:47 +0000 |
commit | 6fbd14fea5c111a23d9074d25499991cbfa58f79 (patch) | |
tree | 0c1f5a77cacc664eadd47216b70e3257337484db /NP-VERSION-GEN | |
parent | 56cf151ae91c5081a99365848a3f060dfe14a68c (diff) | |
download | monitoring-plugins-6fbd14fea5c111a23d9074d25499991cbfa58f79.tar.gz |
Removing CVS/SVN tags and replacing with git-based versioning
For contrib/, full tags have been imported from subversion
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@2091 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'NP-VERSION-GEN')
-rwxr-xr-x | NP-VERSION-GEN | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN new file mode 100755 index 00000000..11697107 --- /dev/null +++ b/NP-VERSION-GEN | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # This is from the Git repository (GIT-VERSION-GEN with modifications) | ||
4 | # | ||
5 | |||
6 | SRC_ROOT=`dirname $0` | ||
7 | |||
8 | NPVF=NP-VERSION-FILE | ||
9 | DEF_VER=1.4.13.git | ||
10 | |||
11 | LF=' | ||
12 | ' | ||
13 | |||
14 | # First see if there is a version file (included in release tarballs), | ||
15 | # then try git-describe, then default. | ||
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` && | ||
21 | case "$VN" in | ||
22 | *$LF*) (exit 1) ;; | ||
23 | release-[0-9]*) | ||
24 | git update-index -q --refresh | ||
25 | test -z "`git diff-index --name-only HEAD --`" || | ||
26 | VN="$VN-dirty" ;; | ||
27 | esac | ||
28 | then | ||
29 | VN=`echo "$VN" | sed -e 's/^release-//' | sed -e 's/-/./g'`; | ||
30 | else | ||
31 | VN="$DEF_VER" | ||
32 | fi | ||
33 | |||
34 | VN=`expr "$VN" : v*'\(.*\)'` | ||
35 | |||
36 | if test -r $NPVF | ||
37 | then | ||
38 | VC=`sed -e 's/^NP_VERSION = //' <$NPVF` | ||
39 | else | ||
40 | VC=unset | ||
41 | fi | ||
42 | test "$VN" = "$VC" || { | ||
43 | echo >&2 "NP_VERSION = $VN" | ||
44 | echo "NP_VERSION = $VN" >$NPVF | ||
45 | } | ||
46 | |||