aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorCorentin Chary <corentin.chary@gmail.com>2012-07-24 08:33:19 +0200
committerCorentin Chary <corentin.chary@gmail.com>2012-07-24 08:33:19 +0200
commit46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d (patch)
tree224d474b5d85c02cd7f74e85d1832fb467ae7733 /bin
parentdjeuscan: smaller icons, change refresh icon (diff)
downloadeuscan-46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d.tar.gz
euscan-46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d.tar.bz2
euscan-46c2ea6f70758c4df56c1bc9cb28e0a0d3637c9d.zip
euscan: use python-git for __version__
Signed-off-by: Corentin Chary <corentin.chary@gmail.com>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/euscan11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/euscan b/bin/euscan
index 8696848..42d63e8 100755
--- a/bin/euscan
+++ b/bin/euscan
@@ -5,21 +5,26 @@ Distributed under the terms of the GNU General Public License v2
"""
from __future__ import print_function
-
+import os
# Meta
__author__ = "Corentin Chary (iksaif)"
__email__ = "corentin.chary@gmail.com"
-__version__ = "git"
__productname__ = "euscan"
__description__ = "A tool to detect new upstream releases."
+if os.path.exists(os.path.join(os.path.dirname(__file__), "..", ".git")):
+ import git
+ repo = git.Repo(os.path.join(os.path.dirname(__file__)))
+ __version__ = "git-%s" % repo.head.commit
+else:
+ __version__ = "git"
+
# Imports
import sys
-import os
import getopt
from errno import EINTR, EINVAL
from httplib import HTTPConnection