Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
match = regex.search(contents)
if not match: return None
return distutils.version.LooseVersion(shlex.split(match.group(2))[0])
match = regex.search(contents)
if not match: return None
return distutils.version.LooseVersion(shlex.split(match.group(2))[0])
+ # XXX: This signature doesn't really make too much sense...
def detectVersionFromGit(self, tagPattern, preStrip = ''):
"""
Helper method that detects a version by using the most recent tag
def detectVersionFromGit(self, tagPattern, preStrip = ''):
"""
Helper method that detects a version by using the most recent tag
This assumes that the current working directory is the deployment.
"""
sh = wizard.shell.Shell()
This assumes that the current working directory is the deployment.
"""
sh = wizard.shell.Shell()
- cmd = ['git', 'describe', '--match', tagPattern, ]
+ cmd = ['git', 'describe', '--tags', '--match', tagPattern, ]
tag = sh.call(*cmd, strip=True)
if tag and len(tag) > len(preStrip) and tag[:len(preStrip)] == preStrip:
tag = tag[len(preStrip):]
tag = sh.call(*cmd, strip=True)
if tag and len(tag) > len(preStrip) and tag[:len(preStrip)] == preStrip:
tag = tag[len(preStrip):]
if not old_options.retry and version and version != "head-scripts": # for ease in testing
shell.call("git", "reset", "-q", "--hard", appstr)
input.infobox("Installing...")
if not old_options.retry and version and version != "head-scripts": # for ease in testing
shell.call("git", "reset", "-q", "--hard", appstr)
input.infobox("Installing...")
+ if not version:
+ version = application.detectVersionFromGit(appname, appname + "-")
v = distutils.version.LooseVersion(version)
if application.needs_web_stub:
application.install(v, options, web_stub_path)
v = distutils.version.LooseVersion(version)
if application.needs_web_stub:
application.install(v, options, web_stub_path)