2019-07-15 15:10:19 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
dir="$1"
|
|
|
|
pkgversion="$2"
|
|
|
|
version="$3"
|
|
|
|
|
2020-08-23 12:26:17 +02:00
|
|
|
if [ -z "$pkgversion" ]; then
|
2019-07-15 15:10:19 +02:00
|
|
|
cd "$dir"
|
|
|
|
if [ -e .git ]; then
|
2020-09-29 16:36:54 +02:00
|
|
|
pkgversion=$(git describe --match 'v*' --dirty) || :
|
2019-07-15 15:10:19 +02:00
|
|
|
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
|