configure.ac: exclude build without running git (#364)

This commit is contained in:
Valérian Rousset 2020-12-13 22:29:23 +01:00 committed by GitHub
parent 3f27399d73
commit 30a32cce3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -152,15 +152,12 @@ AX_SANITIZERS(, [$default_sanitizers], [AC_DEFINE([I3STATUS_ASAN_ENABLED], [], [
AC_OUTPUT AC_OUTPUT
in_git_worktree=`git rev-parse --is-inside-work-tree 2>/dev/null` AS_IF([test -d ${srcdir}/.git], [
if [ "$in_git_worktree" = "true" ]; then srcdir_abs=`readlink -f "$srcdir"`
git_dir=`git rev-parse --git-dir 2>/dev/null` exclude_dir=`pwd | sed "s,^$srcdir_abs/*,,g"`
srcdir=`dirname "$git_dir"` AS_IF([! grep -q "^$exclude_dir" "${srcdir}/.git/info/exclude"],
exclude_dir=`pwd | sed "s,^$srcdir,,g"` [echo "$exclude_dir" >> "${srcdir}/.git/info/exclude"])])
if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then
echo "$exclude_dir" >> "$git_dir/info/exclude"
fi
fi
echo \ echo \
"-------------------------------------------------------------------------------- "--------------------------------------------------------------------------------