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:
parent
9c1f9bfb9f
commit
2c1fdf0572
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue