Skip to content

Commit

Permalink
fix version extraction when building in a larger git tree
Browse files Browse the repository at this point in the history
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 <[email protected]>
[[email protected]: fix troll character U+c2a0]
Signed-off-by: "Yann E. MORIN" <[email protected]>
[Retrieved from:
https://git.buildroot.net/buildroot/tree/package/sslh/0001-secure-version-while-building-sslh-in-a-larger-git-t.patch]
Signed-off-by: Fabrice Fontaine <[email protected]>
  • Loading branch information
ffontaine committed Apr 5, 2019
1 parent e528f51 commit b5d8b2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions genver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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'`
Expand Down

0 comments on commit b5d8b2d

Please sign in to comment.