summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorJerome Martin <jxm@risingtidesystems.com>2011-09-16 01:44:32 +0200
committerJerome Martin <jxm@risingtidesystems.com>2011-09-16 01:45:46 +0200
commit179e8d808a433c456f8b4cfabf368934217306f5 (patch)
treec56a2812705ee5968c810640e2a346c19bb16975 /bin
parente9d33c393fc668eab00512ce649c5622802276e9 (diff)
downloadtargetcli-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-xbin/gen_changelog21
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