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