2023-10-10 21:21:57 +02:00
|
|
|
#!/bin/sh
|
2023-10-11 20:38:34 +02:00
|
|
|
cp -fr ./src/version.h.in ./src/version.h
|
2023-10-10 21:21:57 +02:00
|
|
|
|
2024-05-11 00:51:53 +02:00
|
|
|
HASH=${HASH-$(git rev-parse HEAD)}
|
|
|
|
BRANCH=${BRANCH-$(git branch --show-current)}
|
|
|
|
MESSAGE=${MESSAGE-$(git show | head -n 5 | tail -n 1 | sed -e 's/#//g' -e 's/\"//g')}
|
|
|
|
DATE=${DATE-$(git show --no-patch --format=%cd --date=local)}
|
|
|
|
DIRTY=${DIRTY-$(git diff-index --quiet HEAD -- || echo dirty)}
|
|
|
|
TAG=${TAG-$(git describe --tags)}
|
|
|
|
COMMITS=${COMMITS-$(git rev-list --count HEAD)}
|
2023-10-10 21:21:57 +02:00
|
|
|
|
2023-10-11 20:38:34 +02:00
|
|
|
sed -i -e "s#@HASH@#${HASH}#" ./src/version.h
|
|
|
|
sed -i -e "s#@BRANCH@#${BRANCH}#" ./src/version.h
|
|
|
|
sed -i -e "s#@MESSAGE@#${MESSAGE}#" ./src/version.h
|
2023-12-17 15:29:58 +01:00
|
|
|
sed -i -e "s#@DATE@#${DATE}#" ./src/version.h
|
2023-10-11 20:38:34 +02:00
|
|
|
sed -i -e "s#@DIRTY@#${DIRTY}#" ./src/version.h
|
2023-12-17 15:29:58 +01:00
|
|
|
sed -i -e "s#@TAG@#${TAG}#" ./src/version.h
|
2024-04-05 01:44:21 +02:00
|
|
|
sed -i -e "s#@COMMITS@#${COMMITS}#" ./src/version.h
|