aboutsummaryrefslogtreecommitdiffstats
path: root/configure.py
diff options
context:
space:
mode:
authorlloyd <[email protected]>2011-10-18 12:41:35 +0000
committerlloyd <[email protected]>2011-10-18 12:41:35 +0000
commitab7fef4c50704618cac108478b046c82e40574ec (patch)
tree68fff85564544d1ba2ddeea60db967f7abfd60be /configure.py
parent655b95b22eb86f6f4fb6b9a0897d4271c24581a0 (diff)
If running a non-released version and monotone wasn't installed (or
wasn't in path), get_vc_revision would not catch an OSError exception from subprocess and the whole configure would fail
Diffstat (limited to 'configure.py')
-rwxr-xr-xconfigure.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/configure.py b/configure.py
index d6c632a1a..8ac230fe0 100755
--- a/configure.py
+++ b/configure.py
@@ -41,17 +41,21 @@ def flatten(l):
return sum(l, [])
def get_vc_revision():
- mtn = subprocess.Popen(['mtn', 'automate', 'heads'],
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
+ try:
+ mtn = subprocess.Popen(['mtn', 'automate', 'heads'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
- (stdout, stderr) = mtn.communicate()
+ (stdout, stderr) = mtn.communicate()
- if(stderr != ''):
- #logging.debug('Error getting rev from monotone - %s' % (stderr))
- return 'unknown'
+ if(stderr != ''):
+ logging.debug('Error getting rev from monotone - %s' % (stderr))
+ return 'unknown'
- return 'mtn:' + stdout.strip()
+ return 'mtn:' + stdout.strip()
+ except OSError, e:
+ logging.debug('Error getting rev from monotone - %s' % (e[1]))
+ return 'unknown'
class BuildConfigurationInformation(object):
@@ -65,7 +69,7 @@ class BuildConfigurationInformation(object):
version_datestamp = botan_version.release_datestamp
- version_vc_rev = botan_version.release_vc_rev or get_vc_revision()
+ version_vc_rev = botan_version.release_vc_rev
version_string = '%d.%d.%d' % (version_major, version_minor, version_patch)
"""
@@ -73,6 +77,9 @@ class BuildConfigurationInformation(object):
"""
def __init__(self, options, modules):
+ if self.version_vc_rev is None:
+ self.version_vc_rev = get_vc_revision()
+
self.build_dir = os.path.join(options.with_build_dir, 'build')
self.checkobj_dir = os.path.join(self.build_dir, 'checks')