qemu/scripts/qemu-version.sh
Marc-André Lureau 242fb750bd build-sys: fix git version from -version
Typo introduced with the script.

Fixes: 2c273f32d3 ("meson: generate qemu-version.h")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reported-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20200929143654.518157-1-marcandre.lureau@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-10-12 11:50:23 -04:00

25 lines
400 B
Bash
Executable file

#!/bin/sh
set -eu
dir="$1"
pkgversion="$2"
version="$3"
if [ -z "$pkgversion" ]; then
cd "$dir"
if [ -e .git ]; then
pkgversion=$(git describe --match 'v*' --dirty) || :
fi
fi
if [ -n "$pkgversion" ]; then
fullversion="$version ($pkgversion)"
else
fullversion="$version"
fi
cat <<EOF
#define QEMU_PKGVERSION "$pkgversion"
#define QEMU_FULL_VERSION "$fullversion"
EOF