summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValérian Rousset <tharvik@users.noreply.github.com>2020-12-13 22:29:23 +0100
committerGitHub <noreply@github.com>2020-12-13 22:29:23 +0100
commit30a32cce3a16e6c79a81aad467cfe13c12e688cb (patch)
tree0371e497218e6f3d20182757f4776bcae22eb1ec
parent3f27399d730bb9a66bebfed6aff2660828687ca5 (diff)
configure.ac: exclude build without running git (#364)HEADmaster
-rw-r--r--configure.ac15
1 files changed, 6 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 3468cb1..aadde5b 100644
--- a/configure.ac
+++ b/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 \
"--------------------------------------------------------------------------------