From 8b58789d574289bc3d62f1a93fff2a5f79764c7d Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 9 Sep 2015 17:06:34 +0200 Subject: [PATCH] build: .git may be a file It happens when using a worktree. --- Makefile.am | 2 +- autogen.sh | 2 +- get-version | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 7728212a..78978d05 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ doc_DATA = ChangeLog __force-changelog-generation: ChangeLog: __force-changelog-generation - $(AM_V_GEN)if test -d $(top_srcdir)/.git; then \ + $(AM_V_GEN)if test -e $(top_srcdir)/.git; then \ prev=$$(git describe --tags --always --match '[0-9]*' 2> /dev/null) ; \ for tag in $$(git tag | $(EGREP) '^[0-9]+(\.[0-9]+){1,}$$' | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr); do \ if [ x"$$prev" = x ]; then prev=$$tag ; fi ; \ diff --git a/autogen.sh b/autogen.sh index 95eec1db..13b53906 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,7 +2,7 @@ set -e -[ ! -d .gitmodules ] || { +[ ! -e .gitmodules ] || { echo "autogen.sh: updating git submodules" git submodule init git submodule update diff --git a/get-version b/get-version index b7019beb..5c118094 100755 --- a/get-version +++ b/get-version @@ -29,7 +29,7 @@ if [ -f .dist-version ]; then # Get the version from the file distributed in the tarball. version=$(cat .dist-version) -elif [ -d .git ]; then +elif [ -e .git ]; then # Ger the version from the git repository. version=$(git describe --tags --always --match [0-9]* 2> /dev/null) -- 2.39.5