-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script to get the package version
- Loading branch information
1 parent
70d0566
commit b2c00b3
Showing
5 changed files
with
71 additions
and
20 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
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,37 @@ | ||
#!/bin/bash | ||
|
||
SCRIPTPATH="$(cd "$(dirname "$0")"; pwd -P)" | ||
RELEASE="$(cd ${SCRIPTPATH}; cat ../configure.ac|grep C_INIT|cut -c 21-|rev|cut -c 3-|rev)" | ||
REVISION="$(cd ${SCRIPTPATH}; git rev-list --all |wc -l | tr -d '[[:space:]]')" | ||
|
||
get_release() { | ||
echo "${RELEASE}" | ||
exit 0 | ||
} | ||
|
||
get_revision() { | ||
echo "${REVISION}" | ||
exit 0 | ||
} | ||
|
||
get_version() { | ||
echo "${RELEASE}-${REVISION}" | ||
exit 0 | ||
} | ||
|
||
case "$1" in | ||
--release) | ||
get_release; | ||
;; | ||
--revision) | ||
get_revision; | ||
;; | ||
--version) | ||
get_version; | ||
;; | ||
*) | ||
echo "Usage: ${0} {--release|--revision|--version}" | ||
exit 1 | ||
esac | ||
|
||
exit 0 |