r93035 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93034‎ | r93035 | r93036 >
Date:01:18, 25 July 2011
Author:aaron
Status:ok
Tags:
Comment:
* scap changes:
** Make sure we error-check wmf-config & multiversion code
** Refresh the wikiversions.cdb file on scap
** Removed php-1.17 reference (svn info)
** Call mwversionsinuse with the --home parameter (we don't want the usr/ .dat file here)
* Changed scap-1skins to iterate over the active MW versions
* Changed sync-l10nupdate to only work on a single MW version (1st argument), l10nupdate already calls it once per version
Modified paths:
  • /trunk/tools/mwmultiversion/scripts/l10nupdate (modified) (history)
  • /trunk/tools/mwmultiversion/scripts/scap (modified) (history)
  • /trunk/tools/mwmultiversion/scripts/scap-1skins (modified) (history)
  • /trunk/tools/mwmultiversion/scripts/sync-l10nupdate (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/scripts/scap
@@ -3,47 +3,60 @@
44 BINDIR=/home/wikipedia/bin
55 SOURCE=/home/wikipedia/common
66
7 -# Perform syntax check
8 -
97 if [ ! -S "$SSH_AUTH_SOCK" ]; then
108 echo >&2 "SSH_AUTH_SOCK not set or not pointing to a socket."
119 echo >&2 "Did you start your ssh-agent?"
1210 exit 1
1311 fi
1412
15 -mwVerDbSets=(`mwversionsinuse --withdb`)
 13+mwVerDbSets=(`mwversionsinuse --home --withdb`)
1614 if [ -z "$mwVerDbSets" ]; then
17 - echo "Unable to read wikiversions.dat or it is empty"
 15+ echo "Unable to read wikiversions.dat or it is empty."
1816 exit 1
1917 fi
2018
 19+# Perform syntax check
2120 echo Checking syntax...
 21+if [ ! [ $BINDIR/lint $SOURCE/wmf-config && $BINDIR/lint $SOURCE/multiversion ] ]; then
 22+ echo "Found syntax errors, cannot sync."
 23+ exit 1
 24+fi
 25+# Check syntax for all active MediaWiki versions
2226 for i in "${mwVerDbSets[@]}"
2327 do
2428 mwVerNum=${i%=*}
25 - if ! $BINDIR/lint "$SOURCE"/php-"$mwVerNum"; then
26 - echo Found syntax errors, cannot sync
27 - exit
 29+ if [ ! $BINDIR/lint $SOURCE/php-"$mwVerNum" ]; then
 30+ echo "Found syntax errors, cannot sync."
 31+ exit 1
2832 fi
2933 done
3034
31 -# Update the current machine so that serialization works
 35+# Update wikiversions.cdb from wikiversions.dat
 36+if [ ! $SOURCE/multiversion/refreshWikiversionsCDB ]; then
 37+ echo "Unable to run refreshWikiversionsCDB."
 38+ exit 1
 39+fi
 40+
 41+
 42+# Update the current machine so that serialization works.
 43+# wikiversions.cdb update is pushed and mwscript works.
3244 $BINDIR/sync-common
3345
3446
 47+# Regenerate the extension message file list for all active MediaWiki versions
3548 for i in "${mwVerDbSets[@]}"
3649 do
3750 mwVerNum=${i%=*}
3851 mwDbName=${i#*=}
39 - # Regenerate the extension message file list
40 - echo Updating ExtensionMessages.php...
 52+ echo "Updating ExtensionMessages-$mwVerNum.php..."
4153 mwscript mergeMessageFileList.php --wiki="$mwDbName" \
4254 --list-file=$SOURCE/wmf-config/extension-list \
4355 --output=$SOURCE/wmf-config/ExtensionMessages-"$mwVerNum".php
4456 done
4557
 58+
4659 # Notify
47 -$BINDIR/dologmsg "!log $USER synchronizing Wikimedia installation... $(cd /home/wikipedia/common/php-1.17; svn info|grep ^Revision): $*"
 60+$BINDIR/dologmsg "!log $USER synchronizing Wikimedia installation... : $*"
4861
4962
5063 # Copy
Index: trunk/tools/mwmultiversion/scripts/sync-l10nupdate
@@ -1,14 +1,13 @@
22 #!/bin/bash
33 # This script belongs in /home/wikipedia/bin/.
44 PATH=/bin:/usr/bin:/sbin:/usr/sbin:
 5+MWVER="$1"
56
67 mwVersionNums=(`mwversionsinuse`)
78
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:"
 9+echo "Synchronizing /home/wikipedia/common/php-$MWVER/cache/l10n to /usr/local/apache/common-local/php-$MWVER/cache/l10n..."
 10+echo "mediawiki-installation:"
1211
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
 12+ddsh -cM -g mediawiki-installation \
 13+ "sudo -u mwdeploy rsync -a 10.0.5.8::common/php-$MWVER/cache/l10n/ /usr/local/apache/common-local/php-$MWVER/cache/l10n"
 14+
Index: trunk/tools/mwmultiversion/scripts/scap-1skins
@@ -1,8 +1,12 @@
22 #!/bin/bash
33
4 -sudo -u mwdeploy sh -c '
5 -rsync -a --no-perms 10.0.5.8::common/php-1.17/skins/ \
6 -/usr/local/apache/common-local/php-1.17/skins && \
7 -echo ok || \
8 -echo failed
9 -'
 4+mwVersionNums=(`mwversionsinuse`)
 5+for mwVerNum in "${mwVersionNums[@]}"
 6+do
 7+ sudo -u mwdeploy sh -c "
 8+ rsync -a --no-perms 10.0.5.8::common/php-$mwVerNum/skins/ \
 9+ /usr/local/apache/common-local/php-$mwVerNum/skins && \
 10+ echo ok || \
 11+ echo failed
 12+ "
 13+done
Index: trunk/tools/mwmultiversion/scripts/l10nupdate
@@ -33,7 +33,7 @@
3434 --quiet
3535 then
3636 echo "Completed. Syncing to Apaches"
37 - /home/wikipedia/bin/sync-l10nupdate
 37+ /home/wikipedia/bin/sync-l10nupdate "$mwVerNum"
3838 echo "Clearing message blobs"
3939 mwscript maintenance/wmf/clearMessageBlobs.php --wiki="$mwDbName"
4040 echo "All done"

Status & tagging log