1 From 0c39699da9a3d6534b6d26e7c9686ee76d81b64a Mon Sep 17 00:00:00 2001
2 From: David Bachelart <david.bachelart@bbright.com>
3 Date: Thu, 26 Jan 2017 10:07:47 +0100
4 Subject: [PATCH] fix version extraction when building in a larger git tree
6 sslh uses host git to extract its own version number. In buildroot, this
7 is an issue since extracted information is conflicting with buildroot git
8 status if we use git as VCS for buildroot.
10 Since these git calls are legitimate only if git is used for the sslh
11 subtree only, this patch adds a check : a .git directory has to exist at
12 the root of the project to enable git-extracted version string.
14 Signed-off-by: David Bachelart <david.bachelart@bbright.com>
17 1 file changed, 2 insertions(+), 2 deletions(-)
19 diff --git a/genver.sh b/genver.sh
20 index 79fd0a0..051e57b 100755
27 -if ! `(git status | grep -q "On branch") 2> /dev/null`; then
28 +if [ ! -d .git ] || ! `(git status | grep -q "On branch") 2> /dev/null`; then
29 # If we don't have git, we can't work out what
30 # version this is. It must have been downloaded as a
32 @@ -25,7 +25,7 @@ if ! `(git status | grep -q "On branch") 2> /dev/null`; then
36 -if head=`git rev-parse --verify HEAD 2>/dev/null`; then
37 +if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
38 # generate the version info based on the tag
39 release=`(git describe --tags || git --describe || git describe --all --long) \
40 2>/dev/null | tr -d '\n'`