]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Cleanup version-gen.sh 2635/head
authorWilliam Pursell <williamp@wepay.com>
Thu, 28 Dec 2017 18:45:28 +0000 (10:45 -0800)
committerWilliam Pursell <williamp@wepay.com>
Thu, 28 Dec 2017 18:59:55 +0000 (10:59 -0800)
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.

version-gen.sh

index f16e66168c76d3ecb939d097a332af77e7b81bff..710795f4879fe4c24d32111d8541a4d02897f327 100755 (executable)
@@ -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