projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1454 from rubenk/libi2c-dev-mark-as-linux-only
[collectd.git]
/
version-gen.sh
diff --git
a/version-gen.sh
b/version-gen.sh
index
95b15d8
..
493a6eb
100755
(executable)
--- a/
version-gen.sh
+++ b/
version-gen.sh
@@
-1,13
+1,13
@@
-#!/
usr/bin/env ba
sh
+#!/
bin/
sh
-DEFAULT_VERSION="5.
4.1
.git"
+DEFAULT_VERSION="5.
5.0
.git"
-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
+if [ -d .git ]; then
+ VERSION="`git describe --dirty=+ --abbrev=7 2> /dev/null | grep collectd | sed -e 's/^collectd-//' -e 's/-/./g'`"
+fi
if test -z "$VERSION"; then
VERSION="$DEFAULT_VERSION"
fi
if test -z "$VERSION"; then
VERSION="$DEFAULT_VERSION"
fi
-VERSION="`echo \"$VERSION\" | sed -e 's/-/./g'`"
-
-echo -n "$VERSION"
+printf "%s" "$VERSION"