Jump to content

Translating:Commit MediaWiki core/prepare-commits.cmd

From translatewiki.net
@echo off
REM Copyright: 2009, Siebrand Mazeland / translatewiki.net
REM License: MIT License (http://en.wikipedia.org/wiki/MIT_License#License_terms)

REM REQUIREMENTS:
REM -------------
REM * fromdos.exe in PATH (part of tofrodos: http://www.thefreecountry.com/tofrodos/)
REM * tar.exe in PATH (part of msysgit: http://code.google.com/p/msysgit/downloads/list)
REM * svn.exe in PATH (part of Collabnet Subversion: http://www.collab.net/downloads/subversion/)
REM * wget.exe in PATH (http://gnuwin32.sourceforge.net/packages/wget.htm)
REM -------------

REM Set some basic information
REM Will probably not work if not all paths are in %SystemDrive% (or at least
REM on the same drive.
echo Settings environment paths...
set MWPATH=C:\mediawiki
set DOWNLOADPATH=C:\mediawiki\phase3\languages\messages
set WORKPATH=C:\temp
set XAMPPPATH=C:\xampp
set MWWORKPATH=%WORKPATH%\mediawiki-export

REM probably no need to change anything below
REM -----------------------------------------
echo Updating checked out MediaWiki files...
svn up -q --ignore-externals %MWPATH%
echo Creating work folder...
mkdir %WORKPATH%\mediawiki-export
cd %MWWORKPATH%
pause
echo Downloading updates...
wget http://translatewiki.net/static/mediawiki-export.tgz
echo Unpacking export file...
tar -xzf mediawiki-export.tgz
del /Q %MWWORKPATH%\mediawiki-export.tgz
echo Moving core messages files...
move /Y %MWWORKPATH%\Messages*.php %MWPATH%\phase3\languages\messages
echo Moving mwEmbed message file...
xcopy /Y /Q %MWWORKPATH%\mwEmbed\mwEmbed.i18n.php %MWPATH%\phase3\js2\mwEmbed\php\languages\
rd /S /Q %MWWORKPATH%\mwEmbed
echo Moving extension i18n files...
xcopy /Y /Q /S *.* %MWPATH%\extensions\
cd %WORKPATH%
rd /S /Q %MWWORKPATH%
REM Would not be needed if someone would please fucking get rid again of the
REM requirement to have a working MySQL connection to just rebuild the messages
REM files... *grumble*
cd %XAMPPPATH%
start /min cmd /c mysql_start.bat
cd %MWPATH%\phase3\maintenance\language
echo Rebuilding MediaWiki core messages files...
php rebuildLanguage.php --lang=all --remove-unknown
php rebuildLanguage.php --lang=qqq --remove-unknown
echo Stopping MySQL and closing...
cd C:\xampp
cmd /c mysql_stop.bat
fromdos.exe %MWPATH%\phase3\languages\messages\*.*
echo Done. Exiting...
exit
exit