Merge pull request #2628 from nmschulte/fix_build_outside_repo

Fix build outside repo
This commit is contained in:
Michael Stapelberg 2017-01-10 09:34:19 +01:00 committed by GitHub
commit d4066a6c60
1 changed files with 5 additions and 4 deletions

View File

@ -31,8 +31,8 @@ AX_EXTEND_SRCDIR
AS_IF([test -d ${srcdir}/.git], AS_IF([test -d ${srcdir}/.git],
[ [
VERSION="$(git describe --tags --abbrev=0)" VERSION="$(git -C ${srcdir} describe --tags --abbrev=0)"
I3_VERSION="$(git describe --tags --always) ($(git log --pretty=format:%cd --date=short -n1), branch \\\"$(git describe --tags --always --all | sed s:heads/::)\\\")" I3_VERSION="$(git -C ${srcdir} describe --tags --always) ($(git -C ${srcdir} log --pretty=format:%cd --date=short -n1), branch \\\"$(git -C ${srcdir} describe --tags --always --all | sed s:heads/::)\\\")"
# Mirrors what libi3/is_debug_build.c does: # Mirrors what libi3/is_debug_build.c does:
is_release=$(test $(echo "${I3_VERSION}" | cut -d '(' -f 1 | wc -m) -lt 10 && echo yes || echo no) is_release=$(test $(echo "${I3_VERSION}" | cut -d '(' -f 1 | wc -m) -lt 10 && echo yes || echo no)
], ],
@ -154,8 +154,9 @@ else
print_BUILD_MANS=no print_BUILD_MANS=no
fi fi
in_git_worktree=`git rev-parse --is-inside-work-tree 2>/dev/null`
if "$in_git_worktree" == "true"; then
git_dir=`git rev-parse --git-dir 2>/dev/null` git_dir=`git rev-parse --git-dir 2>/dev/null`
if test -n "$git_dir"; then
srcdir=`dirname "$git_dir"` srcdir=`dirname "$git_dir"`
exclude_dir=`pwd | sed "s,^$srcdir,,g"` exclude_dir=`pwd | sed "s,^$srcdir,,g"`
if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then