1
Fork 0

Made 'buildbot --version' work outside of source directory.

For checked out versions of buildslave, run 'git' command from
proper directory.
This commit is contained in:
Elmir Jagudin 2013-05-15 06:59:45 +02:00
parent 9c1f9bfb9f
commit 2c1fdf0572
1 changed files with 4 additions and 2 deletions

View File

@ -27,13 +27,15 @@ try:
version = open(fn).read().strip()
except IOError:
from subprocess import Popen, PIPE, STDOUT
from subprocess import Popen, PIPE
import re
VERSION_MATCH = re.compile(r'\d+\.\d+\.\d+(\w|-)*')
try:
p = Popen(['git', 'describe', '--tags', '--always'], stdout=PIPE, stderr=STDOUT)
dir = os.path.dirname(os.path.abspath(__file__))
p = Popen(['git', 'describe', '--tags', '--always'], cwd=dir,
stdout=PIPE, stderr=PIPE)
out = p.communicate()[0]
if (not p.returncode) and out: