1c89f616a9
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.
14 lines
241 B
Bash
Executable File
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
|