blob: 86c3f65b7c0c2686741f760ffb4739dedffbbee0 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001Don't pick up version string from parent git repository
2
3If the collectd source is extracted from a tarball underneath a
4directory structure that includes another git repository, that
5repository will be picked up by "git describe" which is not
6desirable. Check whether collectd itself is a git repository and just
7use the default version if not.
8
9Upstream-Status: Pending
10
11Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
12
13diff --git a/version-gen.sh b/version-gen.sh
14index b09be8e..2671066 100755
15--- a/version-gen.sh
16+++ b/version-gen.sh
17@@ -2,8 +2,10 @@
18
19 DEFAULT_VERSION="5.5.0.git"
20
21-VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
22-
23+VERSION=""
24+if test -d .git ; then
25+ VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`"
26+fi
27 if test -z "$VERSION"; then
28 VERSION="$DEFAULT_VERSION"
29 fi