Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add the git revision to the version number for 'alpha' builds * Ensure there is a .git folder * Use `./version.sh` relative path * Fix equality operator for a real bourne shell (like on TravisCI)
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/sh | ||
# | ||
# Build a version number, possibly including the Git revision number. Called | ||
# from configure.ac via AC_INIT. | ||
# | ||
|
||
#set -x | ||
|
||
VERSION=$1 | ||
TAG=$2 | ||
|
||
# Include the Git revision when the release tag is "alpha" | ||
if [ "$TAG" = "alpha" -a -e .git ]; then | ||
REV=$(git rev-parse --short=6 HEAD) | ||
fi | ||
|
||
# Print the version string, depending on how many components are available | ||
if [ "$TAG" != "" -a "$REV" != "" ]; then | ||
printf "%s-%s.%s" $VERSION $TAG $REV | ||
elif [ "$TAG" != "" ]; then | ||
printf "%s-%s" $VERSION $TAG | ||
else | ||
printf "%s" $VERSION | ||
fi |