mqtt, gps: add name parameter to plugin_thread_create()
[collectd.git] / version-gen.sh
index 0b75fc2..e106d80 100755 (executable)
@@ -1,17 +1,13 @@
-#!/usr/bin/env bash
+#!/bin/sh
 
-DEFAULT_VERSION="4.10.9.git"
+DEFAULT_VERSION="5.6.1.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
 
-VERSION="`echo \"$VERSION\" | sed -e 's/-/./g'`"
-
-if test "x`uname -s`" = "xAIX" || test "x`uname -s`" = "xSunOS" ; then
-       echo "$VERSION\c"
-else 
-       echo -n "$VERSION"
-fi
+printf "%s" "$VERSION"