]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/rsync-updater/update-xonotic.bat
fix more windows stuff here. Now it works.
[xonotic/xonotic.git] / misc / tools / rsync-updater / update-xonotic.bat
1 @echo off\r
2 \r
3 cd %~dp0\r
4 \r
5 del /s /q %TEMP%\xonotic-rsync-updater\r
6 mkdir %TEMP%\xonotic-rsync-updater\r
7 for %%f in (*.exe *.dll) do copy /b %%f %TEMP%\xonotic-rsync-updater\\r
8 \r
9 set options=-Prtzil --executability --delete-after --delete-excluded --stats\r
10 \r
11 if exist Xonotic-low goto xonoticlow\r
12 if exist Xonotic-high goto xonotichigh\r
13 if exist ..\..\..\.git goto xonoticdatagit\r
14 if exist ..\..\..\data goto xonoticdata\r
15 goto xonotic\r
16 :xonoticlow\r
17         set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
18         set target=Xonotic-low/\r
19         goto endxonotic\r
20 :xonotichigh\r
21         set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
22         set target=Xonotic-high/\r
23         goto endxonotic\r
24 :xonoticdatagit\r
25         echo NOTE: this is a git repository download. Using the regular update method.\r
26         ..\..\..\all update\r
27         goto end\r
28 :xonoticdata\r
29         if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
30         echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
31         goto end\r
32 :xonoticdatarsync\r
33         set PATH=misc\tools\rsync-updater;%PATH%\r
34         cd ..\..\..\r
35         if exist data\xonotic-rsync-data-low.pk3 goto xonoticdatalow\r
36         if exist data\xonotic-*-data-low.pk3 goto xonoticdatalowfuzzy\r
37         if exist data\xonotic-rsync-data-high.pk3 goto xonoticdatahigh\r
38         if exist data\xonotic-*-data-high.pk3 goto xonoticdatahighfuzzy\r
39         if exist data\xonotic-rsync-data.pk3 goto xonoticdatanormal\r
40         if exist data\xonotic-*-data.pk3 goto xonoticdatanormalfuzzy\r
41         echo FATAL: unrecognized Xonotic build. This update script cannot be used.\r
42         goto end\r
43 :xonoticdatalow\r
44                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
45                 goto endxonoticdata\r
46 :xonoticdatalowfuzzy\r
47                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
48                 set options=%options% -y\r
49                 goto endxonoticdata\r
50 :xonoticdatahigh\r
51                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
52                 goto endxonoticdata\r
53 :xonoticdatahighfuzzy\r
54                 set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
55                 set options=%options% -y\r
56                 goto endxonoticdata\r
57 :xonoticdatanormal\r
58                 set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
59                 goto endxonoticdata\r
60 :xonoticdatanormalfuzzy\r
61                 set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
62                 set options=%options% -y\r
63                 goto endxonoticdata\r
64 :endxonoticdata\r
65         set target=./\r
66         goto endxonotic\r
67 :xonotic\r
68         set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
69         set target=Xonotic/\r
70         goto endxonotic\r
71 :endxonotic\r
72 \r
73 set excludes=\r
74 if not "%XONOTIC_INCLUDE_ALL%" == "" goto endbit\r
75 set excludes=%excludes% --exclude=/xonotic-linux*\r
76 set excludes=%excludes% --exclude=/xonotic-osx-*\r
77 set excludes=%excludes% --exclude=/Xonotic*.app\r
78 set excludes=%excludes% --exclude=/fteqcc/fteqcc.linux*\r
79 set excludes=%excludes% --exclude=/fteqcc/fteqcc.osx\r
80 \r
81 if "%ProgramFiles(x86)%" == "" goto bit32\r
82 :bit64\r
83         if not "%XONOTIC_INCLUDE_32BIT%" == "" goto endbit\r
84         set excludes=%excludes% --exclude=/xonotic.exe\r
85         set excludes=%excludes% --exclude=/xonotic-sdl.exe\r
86         set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
87         set excludes=%excludes% --exclude=/fteqcc/fteqcc.exe\r
88         set excludes=%excludes% --exclude=/bin32\r
89         set excludes=%excludes% --exclude=/*.dll\r
90         goto endbit\r
91 :bit32\r
92         set excludes=%excludes% --exclude=/xonotic-x64.exe\r
93         set excludes=%excludes% --exclude=/xonotic-x64-sdl.exe\r
94         set excludes=%excludes% --exclude=/xonotic-x64-dedicated.exe\r
95         set excludes=%excludes% --exclude=/fteqcc/fteqcc-x64.exe\r
96         set excludes=%excludes% --exclude=/bin64\r
97         goto endbit\r
98 :endbit\r
99 \r
100 for %%f in (*.exe *.dll) do copy /b %%f %TEMP%\xonotic-rsync-updater\\r
101 %TEMP%\xonotic-rsync-updater\rsync %options% %excludes% %url% %target%\r
102 %TEMP%\xonotic-rsync-updater\chmod -R a+x %target%\r
103 \r
104 :end\r
105 del /s /q %TEMP%\xonotic-rsync-updater\r
106 pause\r