]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/app/mediawiki.py
Various refinements from our mass-upgrade run.
[wizard.git] / wizard / app / mediawiki.py
index ef7c1ea605de7c6b5f2de0bd8346cb8aac35fb6c..827c30fbe87d6b2db0c77109dde6bde49dbcd7e6 100644 (file)
@@ -50,7 +50,7 @@ class Application(deploy.Application):
         match = regex.search(contents)
         if not match: return None
         return distutils.version.LooseVersion(match.group(2)[1:-1])
-    def install(self, options):
+    def install(self, version, options):
         try:
             os.unlink("LocalSettings.php")
         except OSError:
@@ -77,7 +77,11 @@ class Application(deploy.Application):
         if result.find("Installation successful") == -1:
             raise install.Failure()
         os.rename('config/LocalSettings.php', 'LocalSettings.php')
-    def upgrade(self, options):
+    def upgrade(self, version, options):
         sh = shell.Shell()
-        sh.call("php", "maintenance/update.php")
+        if not os.path.isfile("AdminSettings.php"):
+            sh.call("git", "checkout", "mediawiki-" + str(version), "--", "AdminSettings.php")
+        result = sh.eval("php", "maintenance/update.php", "--quick", log=True)
+        if not result.rstrip().split()[-1] == "Done.":
+            raise app.UpgradeFailure(result)