aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/collectd/collectd/collectd-version.patch
blob: 1e2b7c159c1428d61dbeadaf08b10f6019e603bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Don't pick up version string from parent git repository

If the collectd source is extracted from a tarball underneath a
directory structure that includes another git repository, that
repository will be picked up by "git describe" which is not
desirable. Check whether collectd itself is a git repository and just
use the default version if not.

Upstream-Status: Pending

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>

diff --git a/version-gen.sh b/version-gen.sh
index e344541..d1c0929 100755
--- a/version-gen.sh
+++ b/version-gen.sh
@@ -2,7 +2,10 @@
 
 DEFAULT_VERSION="5.2.2.git"
 
-VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
+VERSION=""
+if test -d .git ; then
+	VERSION="`git describe 2> /dev/null | sed -e 's/^collectd-//'`"
+fi
 
 if test -z "$VERSION"; then
 	VERSION="$DEFAULT_VERSION"
-- 
1.7.10.4