release-rsync)
release_common
# make sure everything we need is installed and updated
- verbose "$d0"/misc/tools/msys2-linux.sh --schroot=sid rsync
+ verbose "$d0"/misc/tools/msys2-linux.sh --schroot=sid rsync dash
targetroot="$PWD/Xonotic"
verbose cd "$HOME/msys64" # see msys2-linux.sh
verbose cp --parents \
usr/bin/msys-zstd-1.dll \
usr/bin/rsync.exe \
"$targetroot/misc/tools/rsync-updater/"
+ # msys2 sh.exe is currently bash
+ verbose cp usr/bin/dash.exe "$targetroot/misc/tools/rsync-updater/usr/bin/sh.exe"
;;
release)
release_common
@echo off\r
setlocal\r
\r
-if "%1" == "did-copy" goto copied\r
+if "%did_copy%" == "true" goto copied\r
cd %~dp0\r
+:: Windows can't update .exe and .dll files while they're running,\r
+:: it can update the .bat file but that can cause execution glitches.\r
+:: Shell scripts can also glitch if updated while running\r
+:: but can be protected, which update-to-autobuild.sh and rsync-ssl are.\r
rmdir /s /q %TEMP%\xonotic-rsync-updater 2>NUL\r
mkdir %TEMP%\xonotic-rsync-updater\r
copy /b %~nx0 %TEMP%\xonotic-rsync-updater\ >NUL\r
:: windows has no cp -r equivalent, this seems least-bad\r
robocopy usr %TEMP%\xonotic-rsync-updater\usr /e >NUL\r
-%TEMP%\xonotic-rsync-updater\%~n0 did-copy\r
+set did_copy=true\r
+%TEMP%\xonotic-rsync-updater\%~n0 %*\r
:: can only get here if above batch file couldn't be created\r
pause\r
exit /b\r
\r
:copied\r
+set PATH=%TEMP%\xonotic-rsync-updater\usr\bin;%PATH%\r
+:: $PATH $PWD $TEMP and $TMP get automatic cygwin path conversion but $0 doesn't,\r
+:: sourcing the main script and setting a custom $0 also works around broken symlink support.\r
+sh -c ". ./update-to-autobuild.sh" ./%~n0.sh %*\r
\r
-set /p choice=This script will DELETE any custom files in the Xonotic folder. Do you want to continue [Y/N]?\r
-if /i not "%choice%" == "Y" goto end\r
-\r
-set buildtype=release\r
-if "%~n0" == "update-to-autobuild" set buildtype=autobuild\r
-\r
-set options=-Prtzil --delete-after --delete-excluded --stats\r
-\r
-if exist ..\..\..\.git goto xonoticdatagit\r
-if exist Xonotic goto xonoticswitchtonormal\r
-if exist Xonotic-high goto xonoticswitchtohigh\r
-if exist ..\..\..\data goto xonoticdata\r
-goto xonotic\r
-:xonoticdatagit\r
- echo NOTE: this is a git repository download. Using the regular update method.\r
- ..\..\..\all update\r
- goto end\r
-:xonoticswitchtohigh\r
- set PATH=misc\tools\rsync-updater;%PATH%\r
- cd ..\..\..\r
- if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatahighfuzzy\r
- echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
- goto end\r
-:xonoticswitchtonormal\r
- set PATH=misc\tools\rsync-updater;%PATH%\r
- cd ..\..\..\r
- if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatanormalfuzzy\r
- echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
- goto end\r
-:xonoticdata\r
- if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
- echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
- goto end\r
-:xonoticdatarsync\r
- set PATH=misc\tools\rsync-updater;%PATH%\r
- cd ..\..\..\r
- if exist data\xonotic-rsync-data-high.pk3 goto xonoticdatahigh\r
- if exist data\xonotic-*-data-high.pk3 goto xonoticdatahighfuzzy\r
- if exist data\xonotic-rsync-data.pk3 goto xonoticdatanormal\r
- if exist data\xonotic-*-data.pk3 goto xonoticdatanormalfuzzy\r
- echo FATAL: unrecognized Xonotic build. This update script cannot be used.\r
- goto end\r
-:xonoticdatahigh\r
- set package=Xonotic-high\r
- goto endxonoticdata\r
-:xonoticdatahighfuzzy\r
- set package=Xonotic-high\r
- set options=%options% -y\r
- goto endxonoticdata\r
-:xonoticdatanormal\r
- set package=Xonotic\r
- goto endxonoticdata\r
-:xonoticdatanormalfuzzy\r
- set package=Xonotic\r
- set options=%options% -y\r
- goto endxonoticdata\r
-:endxonoticdata\r
- set target=./\r
- goto endxonotic\r
-:xonotic\r
- set package=Xonotic\r
- set target=Xonotic/\r
- goto endxonotic\r
-:endxonotic\r
-set url=beta.xonotic.org/%buildtype%-%package%\r
-\r
-set excludes=\r
-if not "%XONOTIC_INCLUDE_ALL%" == "" goto endbit\r
-set excludes=%excludes% --exclude=/xonotic-linux*\r
-set excludes=%excludes% --exclude=/xonotic-osx-*\r
-set excludes=%excludes% --exclude=/Xonotic*.app\r
-set excludes=%excludes% --exclude=/gmqcc/gmqcc.linux*\r
-set excludes=%excludes% --exclude=/gmqcc/gmqcc.osx\r
-\r
-if "%ProgramFiles(x86)%" == "" goto bit32\r
-:bit64\r
- if not "%XONOTIC_INCLUDE_32BIT%" == "" goto endbit\r
- set excludes=%excludes% --exclude=/xonotic-x86.exe\r
- set excludes=%excludes% --exclude=/xonotic-x86-dedicated.exe\r
- set excludes=%excludes% --exclude=/gmqcc/gmqcc.exe\r
- set excludes=%excludes% --exclude=/bin32\r
- set excludes=%excludes% --exclude=/*.dll\r
- goto endbit\r
-:bit32\r
- set excludes=%excludes% --exclude=/xonotic.exe\r
- set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
- set excludes=%excludes% --exclude=/gmqcc/gmqcc-x64.exe\r
- set excludes=%excludes% --exclude=/bin64\r
- goto endbit\r
-:endbit\r
-\r
-cd %target%\r
-echo Updating %CD% from %url% ...\r
-%TEMP%\xonotic-rsync-updater\usr\bin\rsync %options% %excludes% rsync://%url%/ %target%\r
-\r
-:end\r
pause\r
:: hack: delete running batch file without error by deleting after batch exit\r
(goto) 2>NUL & rmdir /s /q %TEMP%\xonotic-rsync-updater\r
;;
esac
-options="-Prtzil --executability --delete-after --delete-excluded --stats"
+options="-Prtzil --delete-after --delete-excluded --stats"
+if [ "$OS" != "Windows_NT" ]; then
+ options="$options --executability"
+fi
package="Xonotic"
target="../../.."
url="beta.xonotic.org/$buildtype-$package"
excludes=
-if [ -z "$XONOTIC_INCLUDE_ALL" ]; then
+if [ -n "$XONOTIC_INCLUDE_ALL" ]; then
+ : noot noot
+elif [ "$OS" = "Windows_NT" ]; then
+ excludes="$excludes --exclude=/xonotic-linux*"
+ excludes="$excludes --exclude=/xonotic-osx-*"
+ excludes="$excludes --exclude=/Xonotic*.app"
+ excludes="$excludes --exclude=/gmqcc/gmqcc.linux*"
+ excludes="$excludes --exclude=/gmqcc/gmqcc.osx"
+
+ if [ "$PROCESSOR_ARCHITECTURE" = AMD64 ]; then
+ if [ -z "$XONOTIC_INCLUDE_32BIT" ]; then
+ excludes="$excludes --exclude=/xonotic-x86.exe"
+ excludes="$excludes --exclude=/xonotic-x86-dedicated.exe"
+ excludes="$excludes --exclude=/xonotic-x86-wgl.exe"
+ excludes="$excludes --exclude=/bin32"
+ fi
+ else
+ excludes="$excludes --exclude=/xonotic.exe"
+ excludes="$excludes --exclude=/xonotic-dedicated.exe"
+ excludes="$excludes --exclude=/xonotic-wgl.exe"
+ excludes="$excludes --exclude=/bin64"
+ fi
+else
excludes="$excludes --exclude=/*.exe"
excludes="$excludes --exclude=/bin32"
excludes="$excludes --exclude=/*.dll"
@echo off\r
setlocal\r
\r
-if "%1" == "did-copy" goto copied\r
+if "%did_copy%" == "true" goto copied\r
cd %~dp0\r
+:: Windows can't update .exe and .dll files while they're running,\r
+:: it can update the .bat file but that can cause execution glitches.\r
+:: Shell scripts can also glitch if updated while running\r
+:: but can be protected, which update-to-autobuild.sh and rsync-ssl are.\r
rmdir /s /q %TEMP%\xonotic-rsync-updater 2>NUL\r
mkdir %TEMP%\xonotic-rsync-updater\r
copy /b %~nx0 %TEMP%\xonotic-rsync-updater\ >NUL\r
:: windows has no cp -r equivalent, this seems least-bad\r
robocopy usr %TEMP%\xonotic-rsync-updater\usr /e >NUL\r
-%TEMP%\xonotic-rsync-updater\%~n0 did-copy\r
+set did_copy=true\r
+%TEMP%\xonotic-rsync-updater\%~n0 %*\r
:: can only get here if above batch file couldn't be created\r
pause\r
exit /b\r
\r
:copied\r
+set PATH=%TEMP%\xonotic-rsync-updater\usr\bin;%PATH%\r
+:: $PATH $PWD $TEMP and $TMP get automatic cygwin path conversion but $0 doesn't,\r
+:: sourcing the main script and setting a custom $0 also works around broken symlink support.\r
+sh -c ". ./update-to-autobuild.sh" ./%~n0.sh %*\r
\r
-set /p choice=This script will DELETE any custom files in the Xonotic folder. Do you want to continue [Y/N]?\r
-if /i not "%choice%" == "Y" goto end\r
-\r
-set buildtype=release\r
-if "%~n0" == "update-to-autobuild" set buildtype=autobuild\r
-\r
-set options=-Prtzil --delete-after --delete-excluded --stats\r
-\r
-if exist ..\..\..\.git goto xonoticdatagit\r
-if exist ..\..\..\data goto xonoticdata\r
-if exist Xonotic goto xonoticswitchtonormal\r
-if exist Xonotic-high goto xonoticswitchtohigh\r
-goto xonotic\r
-:xonoticdatagit\r
- echo NOTE: this is a git repository download. Using the regular update method.\r
- ..\..\..\all update\r
- goto end\r
-:xonoticswitchtohigh\r
- set PATH=misc\tools\rsync-updater;%PATH%\r
- cd ..\..\..\r
- if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatahighfuzzy\r
- echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
- goto end\r
-:xonoticswitchtonormal\r
- set PATH=misc\tools\rsync-updater;%PATH%\r
- cd ..\..\..\r
- if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatanormalfuzzy\r
- echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
- goto end\r
-:xonoticdata\r
- if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
- echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
- goto end\r
-:xonoticdatarsync\r
- set PATH=misc\tools\rsync-updater;%PATH%\r
- cd ..\..\..\r
- if exist data\xonotic-rsync-data-high.pk3 goto xonoticdatahigh\r
- if exist data\xonotic-*-data-high.pk3 goto xonoticdatahighfuzzy\r
- if exist data\xonotic-rsync-data.pk3 goto xonoticdatanormal\r
- if exist data\xonotic-*-data.pk3 goto xonoticdatanormalfuzzy\r
- echo FATAL: unrecognized Xonotic build. This update script cannot be used.\r
- goto end\r
-:xonoticdatahigh\r
- set package=Xonotic-high\r
- goto endxonoticdata\r
-:xonoticdatahighfuzzy\r
- set package=Xonotic-high\r
- set options=%options% -y\r
- goto endxonoticdata\r
-:xonoticdatanormal\r
- set package=Xonotic\r
- goto endxonoticdata\r
-:xonoticdatanormalfuzzy\r
- set package=Xonotic\r
- set options=%options% -y\r
- goto endxonoticdata\r
-:endxonoticdata\r
- set target=./\r
- goto endxonotic\r
-:xonotic\r
- set package=Xonotic\r
- set target=Xonotic/\r
- goto endxonotic\r
-:endxonotic\r
-set url=beta.xonotic.org/%buildtype%-%package%\r
-\r
-set excludes=\r
-if not "%XONOTIC_INCLUDE_ALL%" == "" goto endbit\r
-set excludes=%excludes% --exclude=/xonotic-linux*\r
-set excludes=%excludes% --exclude=/xonotic-osx-*\r
-set excludes=%excludes% --exclude=/Xonotic*.app\r
-set excludes=%excludes% --exclude=/gmqcc/gmqcc.linux*\r
-set excludes=%excludes% --exclude=/gmqcc/gmqcc.osx\r
-\r
-if "%ProgramFiles(x86)%" == "" goto bit32\r
-:bit64\r
- if not "%XONOTIC_INCLUDE_32BIT%" == "" goto endbit\r
- set excludes=%excludes% --exclude=/xonotic-x86.exe\r
- set excludes=%excludes% --exclude=/xonotic-x86-dedicated.exe\r
- set excludes=%excludes% --exclude=/gmqcc/gmqcc.exe\r
- set excludes=%excludes% --exclude=/bin32\r
- set excludes=%excludes% --exclude=/*.dll\r
- goto endbit\r
-:bit32\r
- set excludes=%excludes% --exclude=/xonotic.exe\r
- set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
- set excludes=%excludes% --exclude=/gmqcc/gmqcc-x64.exe\r
- set excludes=%excludes% --exclude=/bin64\r
- goto endbit\r
-:endbit\r
-\r
-cd %target%\r
-echo Updating %CD% from %url% ...\r
-%TEMP%\xonotic-rsync-updater\usr\bin\rsync %options% %excludes% rsync://%url%/ %target%\r
-\r
-:end\r
pause\r
:: hack: delete running batch file without error by deleting after batch exit\r
(goto) 2>NUL & rmdir /s /q %TEMP%\xonotic-rsync-updater\r