kumquat-buildroot/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch
David Bachelart ddbc51b247 sslh: new package
Signed-off-by: David Bachelart <david.bachelart@bbright.com>
[Thomas:
 - fix download location
 - remove <pkg>_SOURCE variable, it was the default value
 - remove trailing space
 - keep only sha256 hash.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-01-27 21:35:19 +13:00

44 lines
1.5 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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