diff options
| author | David M. Syzdek <syzdek@bindlebinaries.com> | 2012-03-31 01:41:24 -0800 |
|---|---|---|
| committer | David M. Syzdek <syzdek@bindlebinaries.com> | 2012-03-31 01:41:24 -0800 |
| commit | a120d7245279a76b4e6c2af28987510ae046168c (patch) | |
| tree | 216de4e63e8f11f368c682581285b6421aef2d09 /build-aux | |
| parent | a00c8d74521b085f48ab979972e89ed8465c4eda (diff) | |
| download | ldap-utils-a120d7245279a76b4e6c2af28987510ae046168c.tar.gz ldap-utils-a120d7245279a76b4e6c2af28987510ae046168c.tar.bz2 ldap-utils-a120d7245279a76b4e6c2af28987510ae046168c.tar.xz ldap-utils-a120d7245279a76b4e6c2af28987510ae046168c.zip | |
Updating git version script.
Diffstat (limited to 'build-aux')
| -rwxr-xr-x | build-aux/git-package-version.sh | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/build-aux/git-package-version.sh b/build-aux/git-package-version.sh index 8c10f64..bb3cbfa 100755 --- a/build-aux/git-package-version.sh +++ b/build-aux/git-package-version.sh | |||
| @@ -55,6 +55,7 @@ fi; | |||
| 55 | GPV="" # git project version (XXX.YYY.ZZZ.gCCC) | 55 | GPV="" # git project version (XXX.YYY.ZZZ.gCCC) |
| 56 | GBV="" # git build version (gCCC) | 56 | GBV="" # git build version (gCCC) |
| 57 | GAV="" # git application version (XXX.YYY.ZZZ) | 57 | GAV="" # git application version (XXX.YYY.ZZZ) |
| 58 | CPV="" # current git project version | ||
| 58 | 59 | ||
| 59 | # set default file names | 60 | # set default file names |
| 60 | if test "x${GIT_VERSION_FILE}" == "x";then | 61 | if test "x${GIT_VERSION_FILE}" == "x";then |
| @@ -72,6 +73,11 @@ GIT_VERSION_FILE_DIR=`dirname ${GIT_VERSION_FILE}` | |||
| 72 | GIT_VERSION_HEADER_DIR=`dirname ${GIT_VERSION_HEADER}` | 73 | GIT_VERSION_HEADER_DIR=`dirname ${GIT_VERSION_HEADER}` |
| 73 | GIT_VERSION_PREFIX_HEADER_DIR=`dirname ${GIT_VERSION_PREFIX_HEADER}` | 74 | GIT_VERSION_PREFIX_HEADER_DIR=`dirname ${GIT_VERSION_PREFIX_HEADER}` |
| 74 | 75 | ||
| 76 | # sets current version number | ||
| 77 | if test -f ${GIT_VERSION_FILE};then | ||
| 78 | CPV=`cat ${GIT_VERSION_FILE}` | ||
| 79 | fi | ||
| 80 | |||
| 75 | if test -f ${SRCDIR}/.git/config;then | 81 | if test -f ${SRCDIR}/.git/config;then |
| 76 | # retrieve raw output of git describe | 82 | # retrieve raw output of git describe |
| 77 | RAW=`git --git-dir=${SRCDIR}/.git describe --long --abbrev=7 HEAD 2> /dev/null`; | 83 | RAW=`git --git-dir=${SRCDIR}/.git describe --long --abbrev=7 HEAD 2> /dev/null`; |
| @@ -86,7 +92,7 @@ if test -f ${SRCDIR}/.git/config;then | |||
| 86 | GAV=`echo ${GPV} |sed -e 's/\.g[[:xdigit:]]\{0,\}$//g' -e 's/\.0$//g'`; | 92 | GAV=`echo ${GPV} |sed -e 's/\.g[[:xdigit:]]\{0,\}$//g' -e 's/\.0$//g'`; |
| 87 | 93 | ||
| 88 | # write data to file and display results | 94 | # write data to file and display results |
| 89 | if test "x${GPV}" != "x";then | 95 | if test "x${GPV}" != "x" && test "x${GPV}" != "x${CPV}";then |
| 90 | rm -f ${GIT_VERSION_FILE} ${GIT_VERSION_HEADER} ${GIT_VERSION_PREFIX_HEADER} | 96 | rm -f ${GIT_VERSION_FILE} ${GIT_VERSION_HEADER} ${GIT_VERSION_PREFIX_HEADER} |
| 91 | 97 | ||
| 92 | # writes git version file | 98 | # writes git version file |
| @@ -108,15 +114,12 @@ if test -f ${SRCDIR}/.git/config;then | |||
| 108 | echo "#define GIT_BUILD_VERSION ${GBV}" >> ${GIT_VERSION_PREFIX_HEADER}; 2>&1 | 114 | echo "#define GIT_BUILD_VERSION ${GBV}" >> ${GIT_VERSION_PREFIX_HEADER}; 2>&1 |
| 109 | fi | 115 | fi |
| 110 | 116 | ||
| 111 | # displays summary | 117 | # saves current version |
| 112 | if test "x${GIT_PACKAGE_VERSION_VERBOSE}" == "xYES";then | 118 | CPV=${GPV} |
| 113 | echo "Git Package Version: ${GPV}"; | ||
| 114 | echo "Git Application Version: ${GAV}"; | ||
| 115 | echo "Git Build Version: ${GBV}"; | ||
| 116 | else | ||
| 117 | echo "${GPV}" | ||
| 118 | fi | ||
| 119 | fi; | 119 | fi; |
| 120 | fi | 120 | fi |
| 121 | 121 | ||
| 122 | # displays current version | ||
| 123 | echo "${CPV}" | ||
| 124 | |||
| 122 | # end of script | 125 | # end of script |
