* [PATCH] build-sys: fix git version from -version
@ 2020-09-29 13:42 marcandre.lureau
2020-09-29 14:06 ` Eric Blake
0 siblings, 1 reply; 3+ messages in thread
From: marcandre.lureau @ 2020-09-29 13:42 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, lersek, Marc-André Lureau
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Typo introduced with the script.
Fixes: 2c273f32d3 ("meson: generate qemu-version.h")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
scripts/qemu-version.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qemu-version.sh b/scripts/qemu-version.sh
index 03128c56a2..430a7fc581 100755
--- a/scripts/qemu-version.sh
+++ b/scripts/qemu-version.sh
@@ -9,7 +9,7 @@ version="$3"
if [ -z "$pkgversion" ]; then
cd "$dir"
if [ -e .git ]; then
- pkgversion=$(git describe --match 'v*' --dirty | echo "")
+ pkgversion=$(git describe --match 'v*' --dirty || echo "")
fi
fi
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] build-sys: fix git version from -version
2020-09-29 13:42 [PATCH] build-sys: fix git version from -version marcandre.lureau
@ 2020-09-29 14:06 ` Eric Blake
2020-09-29 14:32 ` Marc-André Lureau
0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2020-09-29 14:06 UTC (permalink / raw)
To: marcandre.lureau, qemu-devel; +Cc: pbonzini, lersek
On 9/29/20 8:42 AM, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Typo introduced with the script.
>
> Fixes: 2c273f32d3 ("meson: generate qemu-version.h")
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> scripts/qemu-version.sh | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/qemu-version.sh b/scripts/qemu-version.sh
> index 03128c56a2..430a7fc581 100755
> --- a/scripts/qemu-version.sh
> +++ b/scripts/qemu-version.sh
> @@ -9,7 +9,7 @@ version="$3"
> if [ -z "$pkgversion" ]; then
> cd "$dir"
> if [ -e .git ]; then
> - pkgversion=$(git describe --match 'v*' --dirty | echo "")
This always produces pkgversion="" (the git describe output is ignored
when it is piped to echo).
> + pkgversion=$(git describe --match 'v*' --dirty || echo "")
But this just looks weird. $(echo "") is the same as "". The REAL goal
here appears to be that you want 'set -e' to not die if git describe has
a non-zero exit status. But that's shorter to write as:
pkgversion=$(git describe --match 'v*' --dirty || :)
or even
pkgversion=$(git describe --match 'v*' --dirty) || :
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] build-sys: fix git version from -version
2020-09-29 14:06 ` Eric Blake
@ 2020-09-29 14:32 ` Marc-André Lureau
0 siblings, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2020-09-29 14:32 UTC (permalink / raw)
To: Eric Blake; +Cc: Paolo Bonzini, Laszlo Ersek, QEMU
[-- Attachment #1: Type: text/plain, Size: 1463 bytes --]
Hi
On Tue, Sep 29, 2020 at 6:07 PM Eric Blake <eblake@redhat.com> wrote:
> On 9/29/20 8:42 AM, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Typo introduced with the script.
> >
> > Fixes: 2c273f32d3 ("meson: generate qemu-version.h")
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> > scripts/qemu-version.sh | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/qemu-version.sh b/scripts/qemu-version.sh
> > index 03128c56a2..430a7fc581 100755
> > --- a/scripts/qemu-version.sh
> > +++ b/scripts/qemu-version.sh
> > @@ -9,7 +9,7 @@ version="$3"
> > if [ -z "$pkgversion" ]; then
> > cd "$dir"
> > if [ -e .git ]; then
> > - pkgversion=$(git describe --match 'v*' --dirty | echo "")
>
> This always produces pkgversion="" (the git describe output is ignored
> when it is piped to echo).
>
> > + pkgversion=$(git describe --match 'v*' --dirty || echo "")
>
> But this just looks weird. $(echo "") is the same as "". The REAL goal
> here appears to be that you want 'set -e' to not die if git describe has
> a non-zero exit status. But that's shorter to write as:
>
> pkgversion=$(git describe --match 'v*' --dirty || :)
>
> or even
>
> pkgversion=$(git describe --match 'v*' --dirty) || :
>
>
>
Works for me too. I am sending v2.
thanks
--
Marc-André Lureau
[-- Attachment #2: Type: text/html, Size: 2432 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-29 14:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 13:42 [PATCH] build-sys: fix git version from -version marcandre.lureau
2020-09-29 14:06 ` Eric Blake
2020-09-29 14:32 ` Marc-André Lureau
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.