* [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule
@ 2021-04-19 18:28 Niklas Söderlund
2021-04-19 21:10 ` Hans Verkuil
0 siblings, 1 reply; 4+ messages in thread
From: Niklas Söderlund @ 2021-04-19 18:28 UTC (permalink / raw)
To: Hans Verkuil; +Cc: linux-media, Niklas Söderlund
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule
2021-04-19 18:28 [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule Niklas Söderlund
@ 2021-04-19 21:10 ` Hans Verkuil
2021-04-19 21:22 ` Niklas Söderlund
0 siblings, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2021-04-19 21:10 UTC (permalink / raw)
To: Niklas Söderlund; +Cc: linux-media
On 19/04/2021 20:28, Niklas Söderlund wrote:
> 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)"])
Isn't the same change needed here and in GIT_COMMIT_DATE as well?
Regards,
Hans
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule
2021-04-19 21:10 ` Hans Verkuil
@ 2021-04-19 21:22 ` Niklas Söderlund
2021-04-19 21:30 ` Hans Verkuil
0 siblings, 1 reply; 4+ messages in thread
From: Niklas Söderlund @ 2021-04-19 21:22 UTC (permalink / raw)
To: Hans Verkuil; +Cc: linux-media
Hi Hans,
On 2021-04-19 23:10:37 +0200, Hans Verkuil wrote:
> On 19/04/2021 20:28, Niklas Söderlund wrote:
> > 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)"])
>
> Isn't the same change needed here and in GIT_COMMIT_DATE as well?
Wops, you are correct. I noticed the problem in an older branch where
version.h was generated in different utilities and this is a bad
conflict fix of that.
Do you want me to resend?
>
> Regards,
>
> Hans
>
> >
>
--
Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule
2021-04-19 21:22 ` Niklas Söderlund
@ 2021-04-19 21:30 ` Hans Verkuil
0 siblings, 0 replies; 4+ messages in thread
From: Hans Verkuil @ 2021-04-19 21:30 UTC (permalink / raw)
To: Niklas Söderlund; +Cc: linux-media
On 19/04/2021 23:22, Niklas Söderlund wrote:
> Hi Hans,
>
> On 2021-04-19 23:10:37 +0200, Hans Verkuil wrote:
>> On 19/04/2021 20:28, Niklas Söderlund wrote:
>>> 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)"])
>>
>> Isn't the same change needed here and in GIT_COMMIT_DATE as well?
>
> Wops, you are correct. I noticed the problem in an older branch where
> version.h was generated in different utilities and this is a bad
> conflict fix of that.
>
> Do you want me to resend?
Yes please!
Thanks,
Hans
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-04-19 21:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 18:28 [PATCH] configure.ac: Resolve GIT_SHA even if repository is a submodule Niklas Söderlund
2021-04-19 21:10 ` Hans Verkuil
2021-04-19 21:22 ` Niklas Söderlund
2021-04-19 21:30 ` Hans Verkuil
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.