X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/blobdiff_plain/30380c4b5b28df9670ea5952e14bc485d1d34133..933d5bdd4681d7abfc59851a4a6318b5146ff80c:/wizard/app/mediawiki.py diff --git a/wizard/app/mediawiki.py b/wizard/app/mediawiki.py index c6ac8ae..01cfcaf 100644 --- a/wizard/app/mediawiki.py +++ b/wizard/app/mediawiki.py @@ -6,10 +6,19 @@ import lxml.etree import StringIO import logging -from wizard import app, install, resolve, shell, util +from wizard import app, install, resolve, shell, sql, util from wizard.app import php +# Note: Maintenance script exit codes +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# MediaWiki has notoriously spotty support for exit codes. It has +# gotten better, but there are still always cases that slip through, +# such as . +# As a result, we check both for exit codes AND for the "success" +# message in stdout. + def make_filename_regex(var): + """See :ref:`versioning config ` for more information.""" return 'LocalSettings.php', php.re_var(var) seed = util.dictmap(make_filename_regex, { @@ -22,6 +31,7 @@ seed = util.dictmap(make_filename_regex, { 'WIZARD_DBUSER': 'wgDBuser', 'WIZARD_DBPASSWORD': 'wgDBpassword', 'WIZARD_SECRETKEY': ('wgSecretKey', 'wgProxyKey'), + 'WIZARD_UPGRADEKEY': 'wgUpgradeKey', }) class Application(app.Application): @@ -33,15 +43,49 @@ class Application(app.Application): substitutions = app.make_substitutions(seed) substitutions.update(php.substitutions) install_schema = install.ArgSchema("db", "admin", "email", "title") + random_keys = set(['WIZARD_SECRETKEY', 'WIZARD_UPGRADEKEY']) + def download(self, version): + series = ".".join(str(version).split(".")[:2]) + return "http://download.wikimedia.org/mediawiki/%s/mediawiki-%s.tar.gz" % (series, version) def checkConfig(self, deployment): return os.path.isfile("LocalSettings.php") def detectVersion(self, deployment): return self.detectVersionFromFile("includes/DefaultSettings.php", php.re_var("wgVersion")) def checkWeb(self, deployment): - return self.checkWebPage(deployment, "/index.php?title=Main_Page", "