Download:MediaWiki updater script

From LizardWiki, FastLizard4's wiki and website
Jump to: navigation, search

Bash shell script to easily pull changes from Git for a Git-downloaded MediaWiki installation and its Git-downloaded (or SVN-downloaded) extensions.

Shell script

  • This download is a shell script. It must be run using a shell interpreter. This particular script is written for the bash shell.

Description

I threw together a quick script which will autoupdate MediaWiki if it's been installed from Git. Some notes on usage first, then the source code:

  • To be able to use this script, your MediaWiki core and all extensions must be cloned from Git (gerrit.wikimedia.org). See Download from Git on the MediaWiki wiki. Make sure that you use the command git checkout -b REL<release number> origin/REL<release number> (or, shorter, git checkout REL<release number>; e.g., git checkout REL1_20) to select the version of MediaWiki that you want to install.
  • The same should be done for extensions. That is, after cloning an extension, you should run the command git checkout REL<release number>, using the same release number you installed MediaWiki with. Legacy extensions that are only available through SVN will also be updated by this script, but that's because of Git-SVN, not because of this script.
  • This is a bash script, so it must be run using bash. Bash can be found included on many (all?) Linux distributions, and can be installed on Mac OSX and Unix systems relatively easily. It's harder to install under Windows (you'll need to use a Unix compatibility layer), but doable.

Usage and Installation

The script is a simple bash script that takes an optional parameter. The parameter specifies the branch name (same format as used above, REL<release number> (e.g., REL1_20) to switch everything to (e.g., when updating to a newer MediaWiki version). You can also specify switches as the parameter (though you should not use a switch and branch name at the same time). The --listbranches parameter lists all currently available branches in your MediaWiki repositories. Note, however, this will not fetch any new data, so the command will only list branches present the last time yu updated your MediaWiki installation. The parameter can also be --help for a brief help message, or --version for copyright, author, and version information.

The script should be placed in the Script Path of your MediaWiki installation(s). It should not be readable by the webserver, for security. It will automatically call update.php after it is done.

Licensing and Copyright

Copyright © 2013 Andrew "FastLizard4" Adams.

This software is licensed under the GNU GPL version 3 or later; see http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

Download

Clicking one of the links below will open a text file. To save the file, right click one of the links and select the appropriate "Save target as" option.

  • Download.svgDownload the shell script. Type: text/x-shellscript; charset=us-ascii (Bourne-Again shell script, ASCII text executable). Size: 4.0 KiB.

Source code

Marked up, wikified source code can be found here. Of course, clicking the download link above will take you to the raw source code, which you can then directly save.

Examples

Usage examples, with sample output, can be found here.