mediawiki: Run update script for 1.30 upgrade

This will temporarily fix the issue in #1300 till Debian releases a new version
of MediaWiki.

We should also implement a mechanism to trigger update.php whenever the
MediaWiki package gets updated.

Signed-off-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Joseph Nuthalapati 2018-06-04 11:14:48 +05:30 committed by Sunil Mohan Adapa
parent 4151ab3f10
commit 18912f5373
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 9 additions and 1 deletions

View File

@ -41,6 +41,7 @@ def parse_arguments():
subparsers.add_parser('enable', help='Enable MediaWiki')
subparsers.add_parser('disable', help='Disable MediaWiki')
subparsers.add_parser('setup', help='Setup MediaWiki')
subparsers.add_parser('update', help='Run MediaWiki update script')
help_pub_reg = 'Enable/Disable/Status public user registration.'
pub_reg = subparsers.add_parser('public-registrations', help=help_pub_reg)
@ -123,6 +124,12 @@ def subcommand_change_password(arguments):
])
def subcommand_update(_):
"""Run update.php maintenance script when version upgrades happen."""
update_script = os.path.join(MAINTENANCE_SCRIPTS_DIR, 'update.php')
subprocess.check_call(['php', update_script])
def subcommand_enable(_):
"""Enable web configuration and reload."""
action_utils.service_enable('mediawiki-jobrunner')

View File

@ -26,7 +26,7 @@ from plinth.menu import main_menu
from .manifest import clients
version = 1
version = 2
managed_packages = ['mediawiki', 'imagemagick', 'php-sqlite3']
@ -77,6 +77,7 @@ def setup(helper, old_version=None):
"""Install and configure the module."""
helper.install(managed_packages)
helper.call('setup', actions.superuser_run, 'mediawiki', ['setup'])
helper.call('update', actions.superuser_run, 'mediawiki', ['update'])
helper.call('enable', actions.superuser_run, 'mediawiki', ['enable'])
global service
if service is None: