X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/blobdiff_plain/ff1882aa94a7646bc48cf8fc64ca91ff4691c87e..3965a0be399060b8ff0cee09633c0a0c821d319c:/wizard/app/phpBB.py diff --git a/wizard/app/phpBB.py b/wizard/app/phpBB.py index 49fbf4f..c8fa1f5 100644 --- a/wizard/app/phpBB.py +++ b/wizard/app/phpBB.py @@ -1,8 +1,9 @@ import shutil import logging import os.path +import distutils.version -from wizard import app, install, resolve, util +from wizard import app, install, resolve, sql, util from wizard.app import php #phpBB 104 installs @@ -33,13 +34,14 @@ class Application(app.Application): return os.path.getsize('config.php') def detectVersion(self, deployment): - version = self.detectVersionFromFile('install/database_update.php', php.re_var('updates_to_version')) + version = str(self.detectVersionFromFile('install/update_to_latest.php', php.re_var('updates_to_version'))) if version.startswith('.'): # blehh, but phpBB2 uses '.0.19'... version = '2' + version - return version + return distutils.version.LooseVersion(version) + @app.throws_database_errors def remove(self, deployment, options): - app.remove_database(deployment) + sql.drop(deployment.dsn) def install(self, version, options): old_mode = os.stat(".").st_mode @@ -72,6 +74,10 @@ class Application(app.Application): logging.debug('install.php output:\n\n' + result) if 'Thank you' not in result: raise app.InstallFailure() + # Removing these trees will make upgrade merges annoying. Maybe + # we should patch out the check and stick .htaccess files which + # block access for these folders (we'd probably have to make it + # available again for an upgrade though) #shutil.rmtree('install') #shutil.rmtree('contrib')