From aea03a75cf3ae8e11bb2f23e482f3e98305219c2 Mon Sep 17 00:00:00 2001 From: Alessio Treglia Date: Wed, 7 Dec 2011 21:04:08 +0100 Subject: [PATCH] Small improvements to the releasing mechanism - Append the git information (date and commit) if + envvar LADI_RELEASE is not set and + ./gitcommit.sh exists - Fix the indentation. --- gitcommit.sh | 6 ++++++ setup.py | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 gitcommit.sh diff --git a/gitcommit.sh b/gitcommit.sh new file mode 100755 index 0000000..3b90802 --- /dev/null +++ b/gitcommit.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +COMMIT=`git log --color=never -1 --oneline | cut -d" " -f1` +DATE=`git log --color=never -1 --date=iso | sed -ne "s/Date:\s\+\(.*\).*/\1/p" | cut -d" " -f1 | tr -d "-"` + +echo "$DATE".git"$COMMIT" diff --git a/setup.py b/setup.py index f781799..ecaa871 100755 --- a/setup.py +++ b/setup.py @@ -18,10 +18,21 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +import os +import sys +import subprocess from distutils.core import setup +laditools_version = "1.0~rc2" +get_commit_script = "gitcommit.sh" + +if not os.getenv("LADI_RELEASE") and \ + os.path.isfile(get_commit_script): + commit = subprocess.check_output(["sh", get_commit_script]).strip() + laditools_version += "+" + commit + setup(name='laditools', - version='1.0~rc2', + version=laditools_version, description='Linux Audio Desktop Integration Tools', author='Marc-Olivier Barre and Nedko Arnaudov', author_email='marco@marcochapeau.org', @@ -34,8 +45,8 @@ setup(name='laditools', 'bin/ladiconf'], data_files=[('share/doc/laditools', ['README', 'COPYING', 'INSTALL']), ('share/pixmaps', ['data/ladilog.svg', 'data/laditray.svg', 'data/ladiconf.svg']), - ('share/applications', ['data/laditray.desktop']), - ('share/applications', ['data/ladiconf.desktop']), + ('share/applications', ['data/laditray.desktop']), + ('share/applications', ['data/ladiconf.desktop']), ('share/laditools/data', ['data/laditools_logo.svg', 'data/ladilog_ui.glade', 'data/started.svg',