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

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. ---
  13. genver.sh | 4 ++--
  14. 1 file changed, 2 insertions(+), 2 deletions(-)
  15. diff --git a/genver.sh b/genver.sh
  16. index 79fd0a0..051e57b 100755
  17. --- a/genver.sh
  18. +++ b/genver.sh
  19. @@ -7,7 +7,7 @@ else
  20. QUIET=0
  21. fi
  22. -if ! `(git status | grep -q "On branch") 2> /dev/null`; then
  23. +if [ ! -d .git ] || ! `(git status | grep -q "On branch") 2> /dev/null`; then
  24. # If we don't have git, we can't work out what
  25. # version this is. It must have been downloaded as a
  26. # zip file.
  27. @@ -25,7 +25,7 @@ if ! `(git status | grep -q "On branch") 2> /dev/null`; then
  28. fi
  29. fi
  30. -if head=`git rev-parse --verify HEAD 2>/dev/null`; then
  31. +if [ -d .git ] && head=`git rev-parse --verify HEAD 2>/dev/null`; then
  32. # generate the version info based on the tag
  33. release=`(git describe --tags || git --describe || git describe --all --long) \
  34. 2>/dev/null | tr -d '\n'`
  35. --
  36. 2.1.4