forked from mirror/qemu
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
400 B
Bash
26 lines
400 B
Bash
#!/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
|