Commit 4cadaedb authored by Seblu's avatar Seblu

Add git hash in version for git version

parent d1eadcbc
......@@ -37,4 +37,7 @@ AC_SUBST([zshcompdir], [$with_zshcompdir])
AC_PROG_SED
AM_CONDITIONAL([ISGIT],[test -d .git])
AM_COND_IF([ISGIT],[VERSION=$VERSION+git])
AC_OUTPUT
......@@ -24,4 +24,26 @@ canonical_name="installsystems"
version = "@VERSION@"
verbosity = 1 # 0: quiet, 1: normal, 2: debug
def git_version():
import os
import sys
from subprocess import check_output, CalledProcessError
version = ""
cwd = os.getcwd()
try:
os.chdir(os.path.dirname(sys.argv[0]))
version = check_output(["git", "describe", "--tags", "--always" ],
stdin=open(os.devnull, 'rb'),
stderr=open(os.devnull, "wb")).strip()
if len(version) > 0:
version = "-" + version
except (OSError, CalledProcessError):
pass
finally:
os.chdir(cwd)
return version
if version.find("+git") >= 0:
version += git_version()
__all__ = []
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment