]> scripts.mit.edu Git - wizard.git/commitdiff
Fix bug in detectVersionFromGit, and make install use it.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 5 Jul 2010 18:23:02 +0000 (11:23 -0700)
committerEdward Z. Yang <ezyang@mit.edu>
Mon, 5 Jul 2010 18:23:02 +0000 (11:23 -0700)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
wizard/app/__init__.py
wizard/command/install.py

index 3defa7441af4166ac4d32bb2503933134039197a..6e4b561410b62cce2caa389d2efef6ea54c4e43b 100644 (file)
@@ -413,6 +413,7 @@ class Application(object):
         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
@@ -420,7 +421,7 @@ class Application(object):
         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):]
index 1faa72544084f90d83168edf2d6500ac46b33d00..efbaaa64d4df230917b5d02620250a085750633b 100644 (file)
@@ -53,6 +53,8 @@ Autoinstalls the application %s in the directory DIR.""" % (appname, appname))
         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)