0001-secure-version-while-building-sslh-in-a-larger-git-t.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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
  5. sslh uses host git to extract its own version number. In buildroot, this
  6. is an issue since extracted information is conflicting with buildroot git
  7. status if we use git as VCS for buildroot.
  8. Since these git calls are legitimate only if git is used for the sslh
  9. subtree only, this patch adds a check : a .git directory has to exist at
  10. the root of the project to enable git-extracted version string.
  11. Signed-off-by: David Bachelart <david.bachelart@bbright.com>
  12. [yann.morin.1998@free.fr: fix troll character U+c2a0]
  13. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  14. ---
  15. genver.sh | 4 ++--
  16. 1 file changed, 2 insertions(+), 2 deletions(-)
  17. diff --git a/genver.sh b/genver.sh
  18. index 79fd0a0..051e57b 100755
  19. --- a/genver.sh
  20. +++ b/genver.sh
  21. @@ -7,7 +7,7 @@ else
  22. QUIET=0
  23. fi
  24. -if ! `(git status | grep -q "On branch") 2> /dev/null`; then
  25. +if [ ! -d .git ] || ! `(git status | grep -q "On branch") 2> /dev/null`; then
  26. # If we don't have git, we can't work out what
  27. # version this is. It must have been downloaded as a
  28. # zip file.
  29. @@ -25,7 +25,7 @@ if ! `(git status | grep -q "On branch") 2> /dev/null`; then
  30. fi
  31. fi
  32. -if head=`git rev-parse --verify HEAD 2>/dev/null`; then
  33. +if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
  34. # generate the version info based on the tag
  35. release=`(git describe --tags || git --describe || git describe --all --long) \
  36. 2>/dev/null | tr -d '\n'`
  37. --
  38. 2.1.4