first commit
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python:
|
||||
import os, sys
|
||||
import re
|
||||
|
||||
builder.SetBuildFolder('/')
|
||||
includes = builder.AddFolder('includes')
|
||||
|
||||
argv = [
|
||||
sys.executable,
|
||||
os.path.join(builder.sourcePath, 'buildbot', 'generate_header.py'),
|
||||
os.path.join(Extension.ext_root),
|
||||
os.path.join(builder.buildPath, 'includes'),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
os.path.join(builder.buildFolder, 'includes', 'version_auto.h')
|
||||
]
|
||||
|
||||
repo_head_path = os.path.join(Extension.ext_root, 'product.version')
|
||||
if os.path.exists(os.path.join(Extension.ext_root, '.git')):
|
||||
with open(os.path.join(Extension.ext_root, '.git', 'HEAD')) as fp:
|
||||
head_contents = fp.read().strip()
|
||||
if re.search('^[a-fA-F0-9]{40}$', head_contents):
|
||||
repo_head_path = os.path.join(Extension.ext_root, '.git', 'HEAD')
|
||||
else:
|
||||
git_state = head_contents.split(':')[1].strip()
|
||||
repo_head_path = os.path.join(Extension.ext_root, '.git', git_state)
|
||||
if not os.path.exists(repo_head_path):
|
||||
repo_head_path = os.path.join(Extension.ext_root, '.git', 'HEAD')
|
||||
|
||||
sources = [
|
||||
os.path.join(Extension.ext_root, 'product.version'),
|
||||
repo_head_path,
|
||||
argv[1]
|
||||
]
|
||||
|
||||
for source in sources:
|
||||
if not os.path.exists(source):
|
||||
print(source)
|
||||
for source in sources:
|
||||
if not os.path.exists(source):
|
||||
print(source)
|
||||
|
||||
output_nodes = builder.AddCommand(
|
||||
inputs=sources,
|
||||
argv=argv,
|
||||
outputs=outputs
|
||||
)
|
||||
|
||||
rvalue = output_nodes
|
||||
Reference in New Issue
Block a user