Download:MediaWiki updater script/Source
From LizardWiki, FastLizard4's wiki and website
Current source code for the MediaWiki updater script. Return to the description page
-
#!/bin/bash
-
-
#Updates MediaWiki. Must be run from shell, duh.
-
-
if [ $1 ]
-
then
-
if [ $1 = '--help' ]
-
then
-
echo 'Usage: ./update.sh [branchname OR option]'
-
echo 'Where [branchname] is an optional branch name to switch to.'
-
echo '[option] can be one of the following:'
-
echo '--listbranches - Show all available branches for all extensions'
-
echo '--version - Show version'
-
exit 0
-
elif [ $1 = '--version' ]
-
then
-
echo 'MediaWiki autoupdate script version 2.0 by Andrew "FastLizard4" Adams'
-
echo 'Copyright (C) 2013 Andrew "FastLizard4" Adams <http://fastlizard4.org/wiki/MediaWiki_updater_script>'
-
echo 'License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.'
-
echo 'This is free software: you are free to change and redistribute it.'
-
echo 'There is NO WARRANTY, to the extent permitted by law.'
-
exit 0
-
elif [ $1 = '--listbranches' ]
-
then
-
cd extensions
-
for dir in *; do
-
echo "Branches of extension $dir: "
-
cd $dir && git branch -rl && cd ..
-
done
-
cd ..
-
exit 0
-
else
-
echo "Warning: Switching all to branch $1"
-
fi
-
fi
-
-
echo -n 'Pulling core: '
-
git pull
-
-
cd extensions
-
-
for dir in *; do
-
echo -n "Pulling in extension $dir: "
-
cd $dir && (git pull || exit 1) && cd ..
-
done
-
-
if [ $1 ]
-
then
-
echo -n 'Switching branch in core: '
-
git checkout $1
-
cd extensions
-
for dir in *; do
-
echo -n "Switching branch in extension $dir: "
-
cd $dir && (git checkout $1 || true) && cd ..
-
done
-
cd ..
-
fi
-
-
cd ../maintenance
-
php update.php