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