Files
collectd/version-gen.sh
Ruben Kerkhof a2c0ff89b4 /bin/sh on OSX doesn't understand -n
This breaks PACKAGEVERSION since the -n is left verbatim in the string.
Use the more portable printf instead
2015-05-10 00:11:06 +02:00

14 lines
238 B
Bash
Executable File

#!/bin/sh
DEFAULT_VERSION="5.3.1.git"
VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
if test -z "$VERSION"; then
VERSION="$DEFAULT_VERSION"
fi
VERSION="`echo \"$VERSION\" | sed -e 's/-/./g'`"
printf "%s" "$VERSION"