linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Subject: [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule
Date: Mon, 19 Apr 2021 20:28:32 +0200	[thread overview]
Message-ID: <20210419182832.577010-1-niklas.soderlund@ragnatech.se> (raw)

If the v4l-utils repository is a git submodule the $(top_srcdir)/.git is
a file and not a directory. Update the shell check to allow the test to
pass in both cases.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f144a50d034fbda0..4ac4195cd6e4747e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -588,7 +588,7 @@ fi
 CPPFLAGS="-I\$(top_srcdir)/lib/include -Wall -Wpointer-arith -D_GNU_SOURCE $CPPFLAGS"
 
 # Obtain git SHA of HEAD
-AC_SUBST(GIT_SHA, ["-DGIT_SHA=\$(shell if test -d \$(top_srcdir)/.git ; then git -C \$(top_srcdir) rev-parse --short=12 HEAD ; fi)"])
+AC_SUBST(GIT_SHA, ["-DGIT_SHA=\$(shell if test -e \$(top_srcdir)/.git ; then git -C \$(top_srcdir) rev-parse --short=12 HEAD ; fi)"])
 
 # Obtain git commit count of HEAD
 AC_SUBST(GIT_COMMIT_CNT, ["-DGIT_COMMIT_CNT=\$(shell if test -d \$(top_srcdir)/.git ; then printf '-'; git -C \$(top_srcdir) rev-list --count HEAD ; fi)"])
-- 
2.31.1


             reply	other threads:[~2021-04-19 18:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-19 18:28 Niklas Söderlund [this message]
2021-04-19 21:10 ` [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule Hans Verkuil
2021-04-19 21:22   ` Niklas Söderlund
2021-04-19 21:30     ` Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210419182832.577010-1-niklas.soderlund@ragnatech.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).