]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/rsync-updater/update-to-release.bat
Fix macOS SDL2 framework permissions
[xonotic/xonotic.git] / misc / tools / rsync-updater / update-to-release.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 ..\..\..\.git goto xonoticdatagit\r
22 if exist ..\..\..\data goto xonoticdata\r
23 if exist Xonotic goto xonoticswitchtonormal\r
24 if exist Xonotic-high goto xonoticswitchtohigh\r
25 goto xonotic\r
26 :xonoticdatagit\r
27         echo NOTE: this is a git repository download. Using the regular update method.\r
28         ..\..\..\all update\r
29         goto end\r
30 :xonoticswitchtohigh\r
31         set PATH=misc\tools\rsync-updater;%PATH%\r
32         cd ..\..\..\r
33         if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatahighfuzzy\r
34         echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
35         goto end\r
36 :xonoticswitchtonormal\r
37         set PATH=misc\tools\rsync-updater;%PATH%\r
38         cd ..\..\..\r
39         if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatanormalfuzzy\r
40         echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
41         goto end\r
42 :xonoticdata\r
43         if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
44         echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
45         goto end\r
46 :xonoticdatarsync\r
47         set PATH=misc\tools\rsync-updater;%PATH%\r
48         cd ..\..\..\r
49         if exist data\xonotic-rsync-data-high.pk3 goto xonoticdatahigh\r
50         if exist data\xonotic-*-data-high.pk3 goto xonoticdatahighfuzzy\r
51         if exist data\xonotic-rsync-data.pk3 goto xonoticdatanormal\r
52         if exist data\xonotic-*-data.pk3 goto xonoticdatanormalfuzzy\r
53         echo FATAL: unrecognized Xonotic build. This update script cannot be used.\r
54         goto end\r
55 :xonoticdatahigh\r
56                 set url=rsync://beta.xonotic.org/%buildtype%-Xonotic-high/\r
57                 goto endxonoticdata\r
58 :xonoticdatahighfuzzy\r
59                 set url=rsync://beta.xonotic.org/%buildtype%-Xonotic-high/\r
60                 set options=%options% -y\r
61                 goto endxonoticdata\r
62 :xonoticdatanormal\r
63                 set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
64                 goto endxonoticdata\r
65 :xonoticdatanormalfuzzy\r
66                 set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
67                 set options=%options% -y\r
68                 goto endxonoticdata\r
69 :endxonoticdata\r
70         set target=./\r
71         goto endxonotic\r
72 :xonotic\r
73         set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
74         set target=Xonotic/\r
75         goto endxonotic\r
76 :endxonotic\r
77 \r
78 set excludes=\r
79 if not "%XONOTIC_INCLUDE_ALL%" == "" goto endbit\r
80 set excludes=%excludes% --exclude=/xonotic-linux*\r
81 set excludes=%excludes% --exclude=/xonotic-osx-*\r
82 set excludes=%excludes% --exclude=/Xonotic*.app\r
83 set excludes=%excludes% --exclude=/gmqcc/gmqcc.linux*\r
84 set excludes=%excludes% --exclude=/gmqcc/gmqcc.osx\r
85 \r
86 if "%ProgramFiles(x86)%" == "" goto bit32\r
87 :bit64\r
88         if not "%XONOTIC_INCLUDE_32BIT%" == "" goto endbit\r
89         set excludes=%excludes% --exclude=/xonotic-x86.exe\r
90         set excludes=%excludes% --exclude=/xonotic-x86-dedicated.exe\r
91         set excludes=%excludes% --exclude=/gmqcc/gmqcc.exe\r
92         set excludes=%excludes% --exclude=/bin32\r
93         set excludes=%excludes% --exclude=/*.dll\r
94         goto endbit\r
95 :bit32\r
96         set excludes=%excludes% --exclude=/xonotic.exe\r
97         set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
98         set excludes=%excludes% --exclude=/gmqcc/gmqcc-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