This is an automated email from the ASF dual-hosted git repository.

vatamane pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/main by this push:
     new 2613f6ec6 Use a more reliable "in release" checking method
2613f6ec6 is described below

commit 2613f6ec6169522ebeebb4db268a300fead2b3a8
Author: Nick Vatamaniuc <[email protected]>
AuthorDate: Thu Mar 12 23:16:44 2026 -0400

    Use a more reliable "in release" checking method
    
    When using a git worktree the repository layout [1] will have a .git file at
    the top level with a `gitdir: $path` reference instead of a .git directory, 
so
    check if the .git file or directory exist instead.
    
    [1] https://git-scm.com/docs/gitrepository-layout
---
 Makefile  | 2 +-
 configure | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 17c3c94c3..b0c4ab87d 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,7 @@ GRADLE?=$(CURDIR)/extra/nouveau/gradlew
 
 COUCHDB_GIT_SHA=$(git_sha)
 
-IN_RELEASE = $(shell if [ ! -d .git ]; then echo true; fi)
+IN_RELEASE = $(shell if [ ! -e .git ]; then echo true; fi)
 ifeq ($(IN_RELEASE), true)
 
 # 1. Building from tarball, use version.mk.
diff --git a/configure b/configure
index 819953da4..8292aecb7 100755
--- a/configure
+++ b/configure
@@ -350,12 +350,12 @@ if [ "${WITH_SPIDERMONKEY}" = "false" ] && [ 
"${JS_ENGINE}" = "spidermonkey" ];
 fi
 
 # If we're in a release tarball and we don't have proper, then mark it as 
skipped
-if [ ! -d .git ] && [ "$WITH_PROPER" = "true" ] && [ ! -d src/proper ]; then
+if [ ! -e .git ] && [ "$WITH_PROPER" = "true" ] && [ ! -d src/proper ]; then
     WITH_PROPER="false"
 fi
 
 # If we're in a release tarball and we don't have spidermonkey, then mark it 
as skipped and enable quickjs
-if [ ! -d .git ] && [ "$WITH_SPIDERMONKEY" = "true" ] && [ ! -d 
src/couch/priv/couch_js ]; then
+if [ ! -e .git ] && [ "$WITH_SPIDERMONKEY" = "true" ] && [ ! -d 
src/couch/priv/couch_js ]; then
     echo "NOTICE: Spidermonkey was disabled in release tarball. Setting 
JS_ENGINE=quickjs"
     WITH_SPIDERMONKEY="false"
     JS_ENGINE="quickjs"
@@ -562,7 +562,7 @@ if [ "$WITH_CLOUSEAU" = "true" ]; then
 fi
 
 # only update dependencies, when we are not in a release tarball
-if [ -d .git ] && [ "$SKIP_DEPS" = "false" ]; then
+if [ -e .git ] && [ "$SKIP_DEPS" = "false" ]; then
     echo "==> updating dependencies"
     ${REBAR} get-deps update-deps
 fi

Reply via email to