]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/rsync-updater/update-xonotic.bat
rsync-updater: make sure the chmod command after the rsync will actually work :P
[xonotic/xonotic.git] / misc / tools / rsync-updater / update-xonotic.bat
index 4c797b6cab7157a03c2d78ec94440054847366ab..43d2cc69ddf42da27c23c192429617b2eaf7f9d8 100644 (file)
@@ -1,10 +1,12 @@
 @echo off\r
 \r
+cd %~dp0\r
+\r
 set options=-Prtzil --executability --delete-after --delete-excluded --stats\r
 \r
 if exist Xonotic-low goto xonoticlow\r
 if exist Xonotic-high goto xonotichigh\r
-if exist ..\..\..\data\.git goto xonoticdatagit\r
+if exist ..\..\..\.git goto xonoticdatagit\r
 if exist ..\..\..\data goto xonoticdata\r
 goto xonotic\r
 :xonoticlow\r
@@ -20,12 +22,18 @@ goto xonotic
        ..\..\..\all update\r
        goto end\r
 :xonoticdata\r
-       if exist ..\..\..\data\xonotic-rsync-data-low.pk3 goto xonoticdatalow\r
-       if exist ..\..\..\data\xonotic-*-data-low.pk3 goto xonoticdatalowfuzzy\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
+       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-low.pk3 goto xonoticdatalow\r
+       if exist data\xonotic-*-data-low.pk3 goto xonoticdatalowfuzzy\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
 :xonoticdatalow\r
@@ -50,7 +58,7 @@ goto xonotic
                set options=%options% -y\r
                goto endxonoticdata\r
 :endxonoticdata\r
-       set target=..\..\..\r
+       set target=./\r
        goto endxonotic\r
 :xonotic\r
        set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
@@ -67,6 +75,7 @@ set excludes=%excludes% --exclude=/fteqcc/fteqcc.osx
 \r
 if "%ProgramFiles(x86)%" == "" goto bit32\r
 :bit64\r
+       if not "%XONOTIC_INCLUDE_32BIT%" == "" goto endbit\r
        set excludes=%excludes% --exclude=/xonotic.exe\r
        set excludes=%excludes% --exclude=/xonotic-sdl.exe\r
        set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
@@ -83,8 +92,12 @@ if "%ProgramFiles(x86)%" == "" goto bit32
        goto endbit\r
 :endbit\r
 \r
-rsync %options% %excludes% %url% %target%\r
-chmod -R a+x %target%\r
+del /s %TEMP%\xonotic-rsync-updater\r
+mkdir %TEMP%\xonotic-rsync-updater\r
+for %%f in (*.exe *.dll) do copy /b %%f %TEMP%\xonotic-rsync-updater\\r
+%TEMP%\xonotic-rsync-updater\rsync %options% %excludes% %url% %target%\r
+%TEMP%\xonotic-rsync-updater\chmod -R a+x %target%\r
+del /s %TEMP%\xonotic-rsync-updater\r
 \r
 :end\r
 pause\r