Projet_SETI_RISC-V/riscv-gnu-toolchain/qemu/scripts/qemu-version.sh
2023-03-06 14:48:14 +01: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