gluon/scripts/getversion.sh
Matthias Schiffer 1c89f616a9 build: add support for .scmversion files for GLUON_VERSION and GLUON_SITE_VERSION
Sometimes it is useful to override the default version detection, for
example when local patches are applied to a repo. Allow providing a
version number using a file called .scmversion, which is the same that
the Linux kernel and U-Boot use.
2021-10-07 23:42:38 +02:00

14 lines
241 B
Bash
Executable File

#!/bin/sh
if [ $# -ne 1 ]; then
echo >&2 "Usage: getversion.sh <directory>"
exit 1
fi
cd "$1" || exit 1
cat .scmversion 2>/dev/null && exit 0
git --git-dir=.git describe --always --abbrev=7 --dirty=+ 2>/dev/null && exit 0
echo unknown