diff --git a/version-gen.sh b/version-gen.sh
index 6a91b40fbf7556b4ccd045a70a810018e028747d..493a6ebfb26c71580c87c2d62a631c6af4228ea4 100755 (executable)
--- a/version-gen.sh
+++ b/version-gen.sh
-#!/usr/bin/env bash
+#!/bin/sh
-DEFAULT_VERSION="5.0.5.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
-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"