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