]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/app/mediawiki.py
Suppress ^M characters from Git progress bars.
[wizard.git] / wizard / app / mediawiki.py
index dab8ba4681f408b3ac18cf8d1bcf3c347d1fc97b..3fdec143f66fce2a0da23cbb42f939ad021e3cd6 100644 (file)
@@ -54,9 +54,11 @@ class Application(deploy.Application):
         match = regex.search(contents)
         if not match: return None
         return distutils.version.LooseVersion(match.group(2)[1:-1])
-    def checkWeb(self, d):
-        page = d.fetch("index.php?title=Special:Version")
-        return page.find("MediaWiki is free software") != -1
+    def checkWeb(self, d, out=None):
+        page = d.fetch("/index.php?title=Main_Page")
+        if type(out) is list:
+            out.append(page)
+        return page.find("<!-- Served") != -1
     def install(self, version, options):
         try:
             os.unlink("LocalSettings.php")
@@ -79,7 +81,7 @@ class Application(deploy.Application):
             'SysopPass': options.admin_password,
             'SysopPass2': options.admin_password,
             }
-        result = install.fetch(options, 'config/index.php', post=postdata)
+        result = install.fetch(options, '/config/index.php', post=postdata)
         if options.verbose: print result
         if result.find("Installation successful") == -1:
             raise install.Failure()
@@ -87,7 +89,7 @@ class Application(deploy.Application):
     def upgrade(self, d, version, options):
         sh = shell.Shell()
         if not os.path.isfile("AdminSettings.php"):
-            sh.call("git", "checkout", "mediawiki-" + str(version), "--", "AdminSettings.php")
+            sh.call("git", "checkout", "-q", "mediawiki-" + str(version), "--", "AdminSettings.php")
         try:
             result = sh.eval("php", "maintenance/update.php", "--quick", log=True)
         except shell.CallError as e:
@@ -111,6 +113,7 @@ class Application(deploy.Application):
             sh.call("mysqldump", "--compress", "-r", outfile, *get_mysql_args(deployment))
             sh.call("gzip", "--best", outfile)
         except shell.CallError as e:
+            shutil.rmtree(outdir)
             raise app.BackupFailure(e.stderr)
         return backup
     def restore(self, deployment, backup, options):