Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set the source version number in a clean fashion
This commit changes the version number of the tarball created by 'make dist'. One can set PDNS_BUILD_NUMBER to create incremental version numbers. This commit also adds a message to secpoll about PowerDNS being from git and not a released version. The version produced depends on the branch: master: 0.0.${PDNS_BUILD_NUMBER}g${GIT_HASH} rel/*: ${PREVIOUS_TAG}-${NUM_COMMITS_AFTER_TAG}-${GIT_HASH} any other: 0.0.${BRANCH_NAME}.${PDNS_BUILD_NUM}g${GIT_HASH}
- Loading branch information
1 parent
ee89aae
commit a4e9add
Showing
9 changed files
with
43 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
VERSION="unknown" | ||
|
||
if [ ! -z "$(git rev-parse --abbrev-ref HEAD 2> /dev/null)" ]; then | ||
if $(git rev-parse --abbrev-ref HEAD | grep -q 'rel/'); then | ||
REL_TYPE="$(git rev-parse --abbrev-ref HEAD | cut -d/ -f 2 | cut -d- -f 1)" | ||
VERSION="$(git describe --match=${REL_TYPE}-* --dirty=.dirty | cut -d- -f 2-)" | ||
else | ||
GIT_VERSION=$(git show --no-patch --format=format:%h HEAD) | ||
BRANCH=".$(git rev-parse --abbrev-ref HEAD | perl -p -e 's/-//g;')" | ||
[ "${BRANCH}" = ".master" ] && BRANCH='' | ||
git status | grep -q clean || DIRTY='.dirty' | ||
VERSION="0.0${BRANCH}.${PDNS_BUILD_NUMBER}g${GIT_VERSION}${DIRTY}" | ||
fi | ||
echo "$VERSION" > .version | ||
elif [ -f .version ]; then | ||
VERSION="$(cat .version)" | ||
fi | ||
|
||
echo $VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters