Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | Don't pick up version string from parent git repository |
| 2 | |
| 3 | If the collectd source is extracted from a tarball underneath a |
| 4 | directory structure that includes another git repository, that |
| 5 | repository will be picked up by "git describe" which is not |
| 6 | desirable. Check whether collectd itself is a git repository and just |
| 7 | use the default version if not. |
| 8 | |
| 9 | Upstream-Status: Pending |
| 10 | |
| 11 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> |
| 12 | |
| 13 | diff --git a/version-gen.sh b/version-gen.sh |
| 14 | index 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 |