configure.ac: exclude build without running git (#364)
This commit is contained in:
parent
3f27399d73
commit
30a32cce3a
15
configure.ac
15
configure.ac
@ -152,15 +152,12 @@ AX_SANITIZERS(, [$default_sanitizers], [AC_DEFINE([I3STATUS_ASAN_ENABLED], [], [
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
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`
|
||||
srcdir=`dirname "$git_dir"`
|
||||
exclude_dir=`pwd | sed "s,^$srcdir,,g"`
|
||||
if ! grep -q "^$exclude_dir" "$git_dir/info/exclude"; then
|
||||
echo "$exclude_dir" >> "$git_dir/info/exclude"
|
||||
fi
|
||||
fi
|
||||
AS_IF([test -d ${srcdir}/.git], [
|
||||
srcdir_abs=`readlink -f "$srcdir"`
|
||||
exclude_dir=`pwd | sed "s,^$srcdir_abs/*,,g"`
|
||||
AS_IF([! grep -q "^$exclude_dir" "${srcdir}/.git/info/exclude"],
|
||||
[echo "$exclude_dir" >> "${srcdir}/.git/info/exclude"])])
|
||||
|
||||
|
||||
echo \
|
||||
"--------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user