Index: trunk/tools/mwmultiversion/scripts/mwversionsinuse |
— | — | @@ -1,25 +1,36 @@ |
2 | 2 | #!/bin/sh |
3 | 3 | # Returns a space separated list of all active MW versions (e.g. "x.xx"). |
4 | | -# This script belongs in /usr/bin/ and should be in PATH. |
5 | | -declare -a mwVersionsionNums |
| 4 | +# The versions are defined in /usr/local/apache/common-local/wmf-config/wikiversions.cdb. |
| 5 | +# If --dbonly is passed in, then each item in the list will be a DB name |
| 6 | +# for *some* wiki that uses that version instead of the version number. |
| 7 | +# This script belongs in /usr/bin/. |
| 8 | +declare -a mwVersionsRes |
| 9 | +declare -a mwVersionsNums |
6 | 10 | while read line |
7 | 11 | do |
| 12 | + mwDbName=${line% *} |
8 | 13 | mwVersion=${line#* } |
9 | 14 | mwVersionNum=${mwVersion#*-} |
10 | | - if [ -n "$mwVersionNum" ]; then |
| 15 | + if [ -n "$mwDatabase" -a -n "$mwVersionNum" ]; then |
11 | 16 | mwVersionInArray=0 |
12 | | - for i in "${mwVersionsionNums[@]}" |
| 17 | + for i in "${mwVersionsNums[@]}" |
13 | 18 | do |
14 | 19 | if [ "$i" -eq "$mwVersionNum" ]; then |
15 | 20 | mwVersionInArray=1 |
16 | 21 | break |
17 | 22 | fi |
18 | 23 | done |
| 24 | + |
19 | 25 | if [ $mwVersionInArray -eq 0 ]; then |
20 | | - mwVersionsionNums=("${mwVersionsionNums[@]}" "$mwVersionNum") |
| 26 | + mwVersionsNums=("${mwVersionsNums[@]}" "$mwVersionNum") |
| 27 | + if [ "$1" -eq "--dbonly" ]; then |
| 28 | + mwVersionsRes=("${mwVersionsRes[@]}" "$mwDbName") |
| 29 | + else |
| 30 | + mwVersionsRes=("${mwVersionsRes[@]}" "$mwVersionNum") |
| 31 | + fi |
21 | 32 | fi |
22 | 33 | else |
23 | 34 | exit 1 |
24 | 35 | fi |
25 | 36 | done < /usr/local/apache/common-local/wmf-config/wikiversions.cdb |
26 | | -echo "${mwVersionsionNums[@]}" |
| 37 | +echo "${mwVersionsRes[@]}" |
Index: trunk/tools/mwmultiversion/scripts/scap-2 |
— | — | @@ -6,35 +6,41 @@ |
7 | 7 | if rsync -a --delete --exclude=**/.svn/lock --no-perms \
|
8 | 8 | 10.0.5.8::common/ /usr/local/apache/common-local
|
9 | 9 | then
|
10 | | - echo ok
|
| 10 | + echo "ok"
|
11 | 11 | else
|
12 | | - echo failed
|
| 12 | + echo "failed"
|
13 | 13 | exit 1
|
14 | 14 | fi
|
15 | 15 |
|
16 | | -
|
17 | | -echo -n Compiling texvc...
|
18 | | -
|
19 | | -builddir=`mktemp -dt texvc-build.XXXXXXXXXX`
|
20 | | -if [ -z "$builddir" ]; then
|
21 | | - echo "Unable to create temporary directory"
|
| 16 | +mwVersionNums=(`mwversionsinuse`)
|
| 17 | +if [ -z "$mwVersionNums" ]; then
|
| 18 | + echo "Unable to read wikiversions.db or it is empty"
|
22 | 19 | exit 1
|
23 | 20 | fi
|
24 | 21 |
|
25 | | -rsync -r --exclude=.svn/ /usr/local/apache/common-local/php-1.17/math/ "$builddir"
|
26 | | -cd "$builddir"
|
27 | | -if make -f Makefile texvc >/dev/null 2>/dev/null; then
|
28 | | - echo ok
|
29 | | - install -d /usr/local/apache/uncommon/1.17/bin
|
30 | | - install -m 755 "$builddir"/texvc /usr/local/apache/uncommon/1.17/bin
|
31 | | -else
|
32 | | - echo failed
|
33 | | - exit 1
|
34 | | -fi
|
35 | | -rm -r "$builddir"
|
36 | | -cd /
|
| 22 | +for mwVerNum in "${mwVersionNums[@]}"
|
| 23 | +do
|
| 24 | + echo "MediaWiki $mwVerNum:"
|
| 25 | + echo -n "Compiling texvc..."
|
| 26 | + builddir=`mktemp -dt texvc-build.XXXXXXXXXX`
|
| 27 | + if [ -z "$builddir" ]; then
|
| 28 | + echo "Unable to create temporary directory"
|
| 29 | + exit 1
|
| 30 | + fi
|
37 | 31 |
|
| 32 | + rsync -r --exclude=.svn/ /usr/local/apache/common-local/php-"$mwVerNum"/math/ "$builddir"
|
| 33 | + cd "$builddir"
|
| 34 | + if make -f Makefile texvc >/dev/null 2>/dev/null; then
|
| 35 | + echo "ok"
|
| 36 | + install -d /usr/local/apache/uncommon/"$mwVerNum"/bin
|
| 37 | + install -m 755 "$builddir"/texvc /usr/local/apache/uncommon/"$mwVerNum"/bin
|
| 38 | + else
|
| 39 | + echo "failed"
|
| 40 | + exit 1
|
| 41 | + fi
|
| 42 | + rm -r "$builddir"
|
| 43 | + cd /
|
| 44 | +done
|
38 | 45 |
|
39 | 46 | #echo -n "Restarting apache... "
|
40 | 47 | #/usr/bin/apache-sanity-check && ( sudo /usr/sbin/apache2ctl stop; sudo killall -9 apache2;sleep 3; sudo /usr/sbin/apache2ctl start )
|
41 | | -
|
Index: trunk/tools/mwmultiversion/scripts/sync-l10nupdate |
— | — | @@ -1,7 +1,14 @@ |
2 | 2 | #!/bin/bash
|
| 3 | +# This script belongs in /home/wikipedia/bin/.
|
| 4 | +PATH=/bin:/usr/bin:/sbin:/usr/sbin:
|
3 | 5 |
|
4 | | -echo "Synchronizing /home/wikipedia/common/php/cache/l10n to /usr/local/apache/common-local/php/cache/l10n..."
|
5 | | -echo "mediawiki-installation:"
|
| 6 | +mwVersionNums=(`mwversionsinuse`)
|
6 | 7 |
|
7 | | -ddsh -cM -g mediawiki-installation \
|
8 | | - 'sudo -u mwdeploy rsync -a 10.0.5.8::common/php/cache/l10n/ /usr/local/apache/common-local/php/cache/l10n'
|
| 8 | +for mwVerNum in "${mwVersionNums[@]}"
|
| 9 | +do
|
| 10 | + echo "Synchronizing /home/wikipedia/common/php-$mwVerNum/cache/l10n to /usr/local/apache/common-local/php-$mwVerNum/cache/l10n..."
|
| 11 | + echo "mediawiki-installation:"
|
| 12 | +
|
| 13 | + ddsh -cM -g mediawiki-installation \
|
| 14 | + 'sudo -u mwdeploy rsync -a 10.0.5.8::common/php-$mwVerNum/cache/l10n/ /usr/local/apache/common-local/php-$mwVerNum/cache/l10n'
|
| 15 | +done
|
Index: trunk/tools/mwmultiversion/scripts/l10nupdate |
— | — | @@ -1,21 +1,44 @@ |
2 | 2 | #!/bin/sh
|
| 3 | +# This script belongs in /home/wikipedia/bin/.
|
| 4 | +PATH=/bin:/usr/bin:/sbin:/usr/sbin:
|
| 5 | +
|
3 | 6 | umask 0002
|
| 7 | +
|
4 | 8 | echo "Starting l10nupdate at `date`."
|
5 | 9 | if svn up --ignore-externals /home/wikipedia/l10n/trunk/phase3 &&
|
6 | | - svn up --ignore-externals /home/wikipedia/l10n/trunk/extensions &&
|
7 | | - php /home/wikipedia/common/php/extensions/LocalisationUpdate/update.php \
|
8 | | - --wiki=aawiki \
|
9 | | - --outdir=/home/wikipedia/common/php/cache/l10n \
|
10 | | - --all \
|
11 | | - --quiet
|
| 10 | + svn up --ignore-externals /home/wikipedia/l10n/trunk/extensions
|
12 | 11 | then
|
13 | | - echo "Completed. Syncing to Apaches"
|
14 | | - /home/wikipedia/bin/sync-l10nupdate
|
15 | | - echo "Clearing message blobs"
|
16 | | - php /home/wikipedia/common/php/maintenance/wmf/clearMessageBlobs.php
|
17 | | - echo "All done"
|
| 12 | + echo "SVN update completed."
|
18 | 13 | else
|
19 | | - /home/wikipedia/bin/dologmsg "!log LocalisationUpdate failed"; echo "FAILED";
|
| 14 | + /home/wikipedia/bin/dologmsg "!log LocalisationUpdate failed"
|
| 15 | + echo "FAILED"
|
| 16 | + exit 1;
|
20 | 17 | fi
|
| 18 | +
|
| 19 | +mwDbNames=(`mwversionsinuse --dbonly`)
|
| 20 | +if [ -z "$mwDbNames" ]; then
|
| 21 | + /home/wikipedia/bin/dologmsg "!log LocalisationUpdate failed"
|
| 22 | + echo "FAILED"
|
| 23 | + exit 1;
|
| 24 | +fi
|
| 25 | +
|
| 26 | +for mwDb in "${mwDbNames[@]}"
|
| 27 | +do
|
| 28 | + if mwscript extensions/LocalisationUpdate/update.php \
|
| 29 | + --wiki="$mwDb" \
|
| 30 | + --outdir=/home/wikipedia/common/php/cache/l10n \
|
| 31 | + --all \
|
| 32 | + --quiet
|
| 33 | + then
|
| 34 | + echo "Completed. Syncing to Apaches"
|
| 35 | + /home/wikipedia/bin/sync-l10nupdate
|
| 36 | + echo "Clearing message blobs"
|
| 37 | + mwscript maintenance/wmf/clearMessageBlobs.php --wiki="$mwDb"
|
| 38 | + echo "All done"
|
| 39 | + else
|
| 40 | + /home/wikipedia/bin/dologmsg "!log LocalisationUpdate failed"
|
| 41 | + echo "FAILED"
|
| 42 | + fi
|
| 43 | +done
|
21 | 44 | ## Apache clients should sync updates locally every X hours or at scap time
|
22 | 45 | # Not needed anymore as of 3/20/2011 --Roan
|