Skip to content

Commit

Permalink
Merge branch 'master' of http://github.com/thmo/buildbot
Browse files Browse the repository at this point in the history
  • Loading branch information
Amber Yust committed Sep 30, 2010
2 parents 8d83f27 + f069e90 commit 1bd6ac0
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
28 changes: 28 additions & 0 deletions master/buildbot/__init__.py
@@ -1 +1,29 @@
# strategy:
#
# if there is a VERSION file, use its contents. otherwise, call git to
# get a version string. if that also fails, use 'latest'.
#
import os

version = "latest"

try:
fn = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'VERSION')
version = open(fn).read().strip()

except IOError:
from subprocess import Popen, PIPE
import re

VERSION_MATCH = re.compile(r'\d+\.\d+\.\d+(\w|-)*')

try:
p = Popen(['git', 'describe', '--tags', '--always', '--dirty'], stdout=PIPE)
out = p.communicate()[0]

if (not p.returncode) and out:
v = VERSION_MATCH.search(out)
if v:
version = v.group()
except OSError:
pass
17 changes: 16 additions & 1 deletion master/setup.py
Expand Up @@ -19,6 +19,7 @@
from buildbot import version

from distutils.command.install_data import install_data
from distutils.command.sdist import sdist

def include(d, e):
"""Generate a pair of (directory, file-list) for installation.
Expand Down Expand Up @@ -142,6 +143,19 @@ def finalize_options(self):
)
install_data.finalize_options(self)

def run(self):
install_data.run(self)
# ensure there's a buildbot/VERSION file
open(os.path.join(self.install_dir, 'buildbot', 'VERSION'), 'w').write(version)

class our_sdist(sdist):

def make_release_tree(self, base_dir, files):
sdist.make_release_tree(self, base_dir, files)
# ensure there's a buildbot/VERSION file
open(os.path.join(base_dir, 'buildbot', 'VERSION'), 'w').write(version)


long_description="""
The BuildBot is a system to automate the compile/test cycle required by
most software projects to validate code changes. By automatically
Expand Down Expand Up @@ -221,7 +235,8 @@ def finalize_options(self):
'scripts': scripts,
'cmdclass': {'install_data': install_data_twisted,
'test': TestCommand,
'sdist_test': SdistTestCommand},
'sdist_test': SdistTestCommand,
'sdist': our_sdist},
}

# set zip_safe to false to force Windows installs to always unpack eggs
Expand Down

0 comments on commit 1bd6ac0

Please sign in to comment.