From: William Pursell Date: Thu, 28 Dec 2017 18:45:28 +0000 (-0800) Subject: Cleanup version-gen.sh X-Git-Tag: collectd-5.11.0~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2635%2Fhead;p=thirdparty%2Fcollectd.git Cleanup version-gen.sh Existing script matches too generously. eg, an annotated tag 'foo-connectd-bar' will not be filtered. Effectively, this commit replaces 'grep collectd' with 'grep ^collectd-', but removes the grep and does the filtering directly in sed. --- diff --git a/version-gen.sh b/version-gen.sh index f16e66168..710795f48 100755 --- a/version-gen.sh +++ b/version-gen.sh @@ -3,7 +3,7 @@ DEFAULT_VERSION="5.8.0.git" if [ -d .git ]; then - VERSION="`git describe --dirty=+ --abbrev=7 2> /dev/null | grep collectd | sed -e 's/^collectd-//' -e 's/-/./g'`" + VERSION="`git describe --dirty=+ --abbrev=7 2> /dev/null | sed -e '/^collectd-/!d' -e 's///' -e 'y/-/./'`" fi if test -z "$VERSION"; then