diff options
| author | Jerome Martin <jxm@risingtidesystems.com> | 2011-09-16 01:44:32 +0200 |
|---|---|---|
| committer | Jerome Martin <jxm@risingtidesystems.com> | 2011-09-16 01:45:46 +0200 |
| commit | 179e8d808a433c456f8b4cfabf368934217306f5 (patch) | |
| tree | c56a2812705ee5968c810640e2a346c19bb16975 /bin | |
| parent | e9d33c393fc668eab00512ce649c5622802276e9 (diff) | |
| download | targetcli-179e8d808a433c456f8b4cfabf368934217306f5.tar.gz | |
Updated version numbering code.
* Now uses 'git describe --tags' output, just replacing dashes with dots for
compatibility with RPM version numbers.
* For coherency, RPM and debian version numbers are now the same.
* Removed the timestamp, as it is not needed anymore (even when reordering
commits, the version is non-ambiguous, as for non-tagged commits we have part
of the last commit hash and the number of commits since last tag).
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/gen_changelog | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/bin/gen_changelog b/bin/gen_changelog index 02a9e2f..f0b0d8a 100755 --- a/bin/gen_changelog +++ b/bin/gen_changelog @@ -20,22 +20,7 @@ EMAIL=$(git config --get user.email) DATE=$(date +'%a, %d %b %Y %H:%M:%S %z') SRCPKG=$(cat debian/control | grep ^Source | awk '{print $2}') - -LAST_TAG=$(git tag | tail -1) -if [ -z $LAST_TAG ]; then - LAST_TAG='0.0' -fi - -COMMIT=$(git log ${LAST_TAG}..HEAD | head -1 | colrm 1 7 | colrm 8) -TS=$(date +%Y%m%d%H%M%S) - -if [ -z $COMMIT ]; then - VERSION="${LAST_TAG}" - RH_VERSION="${LAST_TAG}" -else - VERSION="${LAST_TAG}-${TS}.${COMMIT}" - RH_VERSION="${LAST_TAG}.${TS}.${COMMIT}" -fi +VERSION=$(basename $(git describe --tags | tr - .)) sed -i "s/__version__ = .*/__version__ = '${VERSION}'/g" ${SRCPKG}/__init__.py @@ -47,6 +32,6 @@ echo " -- ${NAME} <${EMAIL}> ${DATE}" >> debian/changelog RH_SPEC="redhat/rtsadmin.spec" cp redhat/rtsadmin.spec.tmpl $RH_SPEC -sed -i "s/Version:\( *\).*/Version:\1${RH_VERSION}/g" $RH_SPEC -echo "* $(date +'%a %b %d %Y') ${NAME} <${EMAIL}> - ${RH_VERSION}" >> $RH_SPEC +sed -i "s/Version:\( *\).*/Version:\1${VERSION}/g" $RH_SPEC +echo "* $(date +'%a %b %d %Y') ${NAME} <${EMAIL}> - ${VERSION}" >> $RH_SPEC echo "- Generated package." >> $RH_SPEC |
