--- /dev/null
+import math
+import distutils.version
+
+from wizard import app, command, deploy, shell, util
+
+def main(argv, baton):
+ options, args = parse_args(argv, baton)
+ appname = args[0]
+ # grab all the supported versions
+ application = app.getApplication(appname)
+ tags = set(shell.eval("git", "--git-dir=" + application.repository(options.srv_path), "tag").strip().split())
+ unsupported = set()
+ for d in deploy.parse_install_lines(appname, options.versions_path):
+ version = d.detectVersion()
+ if "wordpress-%s" % version not in tags:
+ unsupported.add(version)
+ for v in unsupported:
+ print v
+
+def parse_args(argv, baton):
+ usage = """usage: %prog summary unsupported [ARGS] APP
+
+Determines what application versions are unsupported in our
+repository but are extant in migrated/unmigrated installs.
+We have to calculate the real version using our heuristic,
+since Git may lie if the user manually upgraded their install."""
+ parser = command.WizardOptionParser(usage)
+ baton.push(parser, "versions_path")
+ baton.push(parser, "srv_path")
+ options, args = parser.parse_all(argv)
+ if len(args) > 1:
+ parser.error("too many arguments")
+ return options, args
+
Prints graphs of version usage in autoinstallers
Examples:
- %prog summary list
+ %prog summary
Show graphs for all autoinstall versions
- %prog summary list mediawiki
+ %prog summary version mediawiki
Show graph for MediaWiki autoinstall versions"""
parser = command.WizardOptionParser(usage)
baton.push(parser, "versions_path")
Checks if our version and the version number recorded in a file
are consistent.
"""
+ real = self.detectVersion()
+ if not str(real) == self.app_version.pristine_tag.partition('-')[2]:
+ raise VersionMismatchError(real, self.version)
+
+ @property
+ @chdir_to_location
+ def detectVersion(self):
+ """
+ Returns the real version, based on filesystem, of install.
+
+ Throws a :class:`VersionDetectionError` if we couldn't figure out
+ what the real version was.
+ """
real = self.application.detectVersion(self)
if not real:
raise VersionDetectionError
- elif not str(real) == self.app_version.pristine_tag.partition('-')[2]:
- raise VersionMismatchError(real, self.version)
+ return real
@property
@chdir_to_location