]> git.rm.cloudns.org Git - xonotic/xonotic.git/commitdiff
rsync updater: add support for running from inside the xonotic directory
authorRudolf Polzer <divverent@xonotic.org>
Fri, 11 Nov 2011 08:39:46 +0000 (09:39 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Fri, 11 Nov 2011 08:39:46 +0000 (09:39 +0100)
misc/tools/rsync-updater/update-xonotic.bat
misc/tools/rsync-updater/update-xonotic.sh

index 1b02da0927f2b241403104c68dd5074e6d33140b..4c797b6cab7157a03c2d78ec94440054847366ab 100644 (file)
@@ -4,19 +4,58 @@ set options=-Prtzil --executability --delete-after --delete-excluded --stats
 \r
 if exist Xonotic-low goto xonoticlow\r
 if exist Xonotic-high goto xonotichigh\r
+if exist ..\..\..\data\.git goto xonoticdatagit\r
+if exist ..\..\..\data goto xonoticdata\r
 goto xonotic\r
 :xonoticlow\r
-set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
-set target=Xonotic-low/\r
-goto endxonotic\r
+       set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
+       set target=Xonotic-low/\r
+       goto endxonotic\r
 :xonotichigh\r
-set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
-set target=Xonotic-high/\r
-goto endxonotic\r
+       set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
+       set target=Xonotic-high/\r
+       goto endxonotic\r
+:xonoticdatagit\r
+       echo NOTE: this is a git repository download. Using the regular update method.\r
+       ..\..\..\all update\r
+       goto end\r
+:xonoticdata\r
+       if exist ..\..\..\data\xonotic-rsync-data-low.pk3 goto xonoticdatalow\r
+       if exist ..\..\..\data\xonotic-*-data-low.pk3 goto xonoticdatalowfuzzy\r
+       if exist ..\..\..\data\xonotic-rsync-data-high.pk3 goto xonoticdatahigh\r
+       if exist ..\..\..\data\xonotic-*-data-high.pk3 goto xonoticdatahighfuzzy\r
+       if exist ..\..\..\data\xonotic-rsync-data.pk3 goto xonoticdatanormal\r
+       if exist ..\..\..\data\xonotic-*-data.pk3 goto xonoticdatanormalfuzzy\r
+       echo FATAL: unrecognized Xonotic build. This update script cannot be used.\r
+       goto end\r
+:xonoticdatalow\r
+               set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
+               goto endxonoticdata\r
+:xonoticdatalowfuzzy\r
+               set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/\r
+               set options=%options% -y\r
+               goto endxonoticdata\r
+:xonoticdatahigh\r
+               set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
+               goto endxonoticdata\r
+:xonoticdatahighfuzzy\r
+               set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/\r
+               set options=%options% -y\r
+               goto endxonoticdata\r
+:xonoticdatanormal\r
+               set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
+               goto endxonoticdata\r
+:xonoticdatanormalfuzzy\r
+               set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
+               set options=%options% -y\r
+               goto endxonoticdata\r
+:endxonoticdata\r
+       set target=..\..\..\r
+       goto endxonotic\r
 :xonotic\r
-set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
-set target=Xonotic/\r
-goto endxonotic\r
+       set url=rsync://beta.xonotic.org/autobuild-Xonotic/\r
+       set target=Xonotic/\r
+       goto endxonotic\r
 :endxonotic\r
 \r
 set excludes=\r
@@ -28,22 +67,24 @@ set excludes=%excludes% --exclude=/fteqcc/fteqcc.osx
 \r
 if "%ProgramFiles(x86)%" == "" goto bit32\r
 :bit64\r
-set excludes=%excludes% --exclude=/xonotic.exe\r
-set excludes=%excludes% --exclude=/xonotic-sdl.exe\r
-set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
-set excludes=%excludes% --exclude=/fteqcc/fteqcc.exe\r
-set excludes=%excludes% --exclude=/bin32\r
-set excludes=%excludes% --exclude=/*.dll\r
-goto endbit\r
+       set excludes=%excludes% --exclude=/xonotic.exe\r
+       set excludes=%excludes% --exclude=/xonotic-sdl.exe\r
+       set excludes=%excludes% --exclude=/xonotic-dedicated.exe\r
+       set excludes=%excludes% --exclude=/fteqcc/fteqcc.exe\r
+       set excludes=%excludes% --exclude=/bin32\r
+       set excludes=%excludes% --exclude=/*.dll\r
+       goto endbit\r
 :bit32\r
-set excludes=%excludes% --exclude=/xonotic-x64.exe\r
-set excludes=%excludes% --exclude=/xonotic-x64-sdl.exe\r
-set excludes=%excludes% --exclude=/xonotic-x64-dedicated.exe\r
-set excludes=%excludes% --exclude=/fteqcc/fteqcc-x64.exe\r
-set excludes=%excludes% --exclude=/bin64\r
-goto endbit\r
+       set excludes=%excludes% --exclude=/xonotic-x64.exe\r
+       set excludes=%excludes% --exclude=/xonotic-x64-sdl.exe\r
+       set excludes=%excludes% --exclude=/xonotic-x64-dedicated.exe\r
+       set excludes=%excludes% --exclude=/fteqcc/fteqcc-x64.exe\r
+       set excludes=%excludes% --exclude=/bin64\r
+       goto endbit\r
 :endbit\r
 \r
 rsync %options% %excludes% %url% %target%\r
 chmod -R a+x %target%\r
+\r
+:end\r
 pause\r
index 4cd2af226354630f47fa541e26b271d8b6343164..da21ff552c321040736821ebd571b21f4e0535c1 100755 (executable)
@@ -13,6 +13,30 @@ if [ -d "Xonotic-low" ]; then
 elif [ -d "Xonotic-high" ]; then
        url="rsync://beta.xonotic.org/autobuild-Xonotic-high/"
        target="Xonotic-high/"
+elif [ -d "../../../data/.git" ]; then
+       echo >&2 "NOTE: this is a git repository download. Using the regular update method."
+       exec ../../../all update
+elif [ -d "../../../data" ]; then
+       if [ -f ../../../data/xonotic-rsync-data-low.pk3 ]; then
+               url="rsync://beta.xonotic.org/autobuild-Xonotic-low/"
+       elif [ -f ../../../data/xonotic-*-data-low.pk3 ]; then
+               url="rsync://beta.xonotic.org/autobuild-Xonotic-low/"
+               options="$options -y" # use fuzzy matching because file names differ
+       elif [ -f ../../../data/xonotic-rsync-data-high.pk3 ]; then
+               url="rsync://beta.xonotic.org/autobuild-Xonotic-high/"
+       elif [ -f ../../../data/xonotic-*-data-high.pk3 ]; then
+               url="rsync://beta.xonotic.org/autobuild-Xonotic-high/"
+               options="$options -y" # use fuzzy matching because file names differ
+       elif [ -f ../../../data/xonotic-rsync-data.pk3 ]; then
+               url="rsync://beta.xonotic.org/autobuild-Xonotic/"
+       elif [ -f ../../../data/xonotic-*-data.pk3 ]; then
+               url="rsync://beta.xonotic.org/autobuild-Xonotic/"
+               options="$options -y" # use fuzzy matching because file names differ
+       else
+               echo >&2 "FATAL: unrecognized Xonotic build. This update script cannot be used."
+               exit 1
+       fi
+       target="../../.."
 else
        url="rsync://beta.xonotic.org/autobuild-Xonotic/"
        target="Xonotic/"