mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-10 09:44:13 +00:00
4c2c4085f1
This fixes m1n1 stage2 version numbers (for .tar.gz downloads) as long as the directory name is left intact, and also supports packagers passing their own version number if needed. Signed-off-by: Hector Martin <marcan@marcan.st>
17 lines
379 B
Bash
Executable file
17 lines
379 B
Bash
Executable file
#!/bin/sh
|
|
cd "$(dirname "$0")"
|
|
|
|
dirbase="$(basename "$(pwd)")"
|
|
|
|
if [ -n "$M1N1_VERSION_TAG" ]; then
|
|
version="$M1N1_VERSION_TAG"
|
|
elif [ -e ".git" ]; then
|
|
version="$(git describe --tags --always --dirty)"
|
|
elif [ "${dirbase:0:5}" == "m1n1-" ]; then
|
|
version="${dirbase:5}"
|
|
version="v${version##v}"
|
|
else
|
|
version="unknown"
|
|
fi
|
|
|
|
echo "#define BUILD_TAG \"$version\""
|