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")
- return page.find("<!-- Served by") != -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")
'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()
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:
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):