[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] build-sys: fix git version from -version
From: |
Eric Blake |
Subject: |
Re: [PATCH] build-sys: fix git version from -version |
Date: |
Tue, 29 Sep 2020 09:06:08 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
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