From fae8ca72e45b61b04c5cce414356144d8ac93c95 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Fri, 11 Nov 2011 09:39:46 +0100 Subject: [PATCH] rsync updater: add support for running from inside the xonotic directory --- misc/tools/rsync-updater/update-xonotic.bat | 85 +++++++++++++++------ misc/tools/rsync-updater/update-xonotic.sh | 24 ++++++ 2 files changed, 87 insertions(+), 22 deletions(-) diff --git a/misc/tools/rsync-updater/update-xonotic.bat b/misc/tools/rsync-updater/update-xonotic.bat index 1b02da09..4c797b6c 100644 --- a/misc/tools/rsync-updater/update-xonotic.bat +++ b/misc/tools/rsync-updater/update-xonotic.bat @@ -4,19 +4,58 @@ set options=-Prtzil --executability --delete-after --delete-excluded --stats if exist Xonotic-low goto xonoticlow if exist Xonotic-high goto xonotichigh +if exist ..\..\..\data\.git goto xonoticdatagit +if exist ..\..\..\data goto xonoticdata goto xonotic :xonoticlow -set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/ -set target=Xonotic-low/ -goto endxonotic + set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/ + set target=Xonotic-low/ + goto endxonotic :xonotichigh -set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/ -set target=Xonotic-high/ -goto endxonotic + set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/ + set target=Xonotic-high/ + goto endxonotic +:xonoticdatagit + echo NOTE: this is a git repository download. Using the regular update method. + ..\..\..\all update + goto end +:xonoticdata + if exist ..\..\..\data\xonotic-rsync-data-low.pk3 goto xonoticdatalow + if exist ..\..\..\data\xonotic-*-data-low.pk3 goto xonoticdatalowfuzzy + if exist ..\..\..\data\xonotic-rsync-data-high.pk3 goto xonoticdatahigh + if exist ..\..\..\data\xonotic-*-data-high.pk3 goto xonoticdatahighfuzzy + if exist ..\..\..\data\xonotic-rsync-data.pk3 goto xonoticdatanormal + if exist ..\..\..\data\xonotic-*-data.pk3 goto xonoticdatanormalfuzzy + echo FATAL: unrecognized Xonotic build. This update script cannot be used. + goto end +:xonoticdatalow + set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/ + goto endxonoticdata +:xonoticdatalowfuzzy + set url=rsync://beta.xonotic.org/autobuild-Xonotic-low/ + set options=%options% -y + goto endxonoticdata +:xonoticdatahigh + set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/ + goto endxonoticdata +:xonoticdatahighfuzzy + set url=rsync://beta.xonotic.org/autobuild-Xonotic-high/ + set options=%options% -y + goto endxonoticdata +:xonoticdatanormal + set url=rsync://beta.xonotic.org/autobuild-Xonotic/ + goto endxonoticdata +:xonoticdatanormalfuzzy + set url=rsync://beta.xonotic.org/autobuild-Xonotic/ + set options=%options% -y + goto endxonoticdata +:endxonoticdata + set target=..\..\.. + goto endxonotic :xonotic -set url=rsync://beta.xonotic.org/autobuild-Xonotic/ -set target=Xonotic/ -goto endxonotic + set url=rsync://beta.xonotic.org/autobuild-Xonotic/ + set target=Xonotic/ + goto endxonotic :endxonotic set excludes= @@ -28,22 +67,24 @@ set excludes=%excludes% --exclude=/fteqcc/fteqcc.osx if "%ProgramFiles(x86)%" == "" goto bit32 :bit64 -set excludes=%excludes% --exclude=/xonotic.exe -set excludes=%excludes% --exclude=/xonotic-sdl.exe -set excludes=%excludes% --exclude=/xonotic-dedicated.exe -set excludes=%excludes% --exclude=/fteqcc/fteqcc.exe -set excludes=%excludes% --exclude=/bin32 -set excludes=%excludes% --exclude=/*.dll -goto endbit + set excludes=%excludes% --exclude=/xonotic.exe + set excludes=%excludes% --exclude=/xonotic-sdl.exe + set excludes=%excludes% --exclude=/xonotic-dedicated.exe + set excludes=%excludes% --exclude=/fteqcc/fteqcc.exe + set excludes=%excludes% --exclude=/bin32 + set excludes=%excludes% --exclude=/*.dll + goto endbit :bit32 -set excludes=%excludes% --exclude=/xonotic-x64.exe -set excludes=%excludes% --exclude=/xonotic-x64-sdl.exe -set excludes=%excludes% --exclude=/xonotic-x64-dedicated.exe -set excludes=%excludes% --exclude=/fteqcc/fteqcc-x64.exe -set excludes=%excludes% --exclude=/bin64 -goto endbit + set excludes=%excludes% --exclude=/xonotic-x64.exe + set excludes=%excludes% --exclude=/xonotic-x64-sdl.exe + set excludes=%excludes% --exclude=/xonotic-x64-dedicated.exe + set excludes=%excludes% --exclude=/fteqcc/fteqcc-x64.exe + set excludes=%excludes% --exclude=/bin64 + goto endbit :endbit rsync %options% %excludes% %url% %target% chmod -R a+x %target% + +:end pause diff --git a/misc/tools/rsync-updater/update-xonotic.sh b/misc/tools/rsync-updater/update-xonotic.sh index 4cd2af22..da21ff55 100755 --- a/misc/tools/rsync-updater/update-xonotic.sh +++ b/misc/tools/rsync-updater/update-xonotic.sh @@ -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/" -- 2.39.2