]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
Update rsync scripts and README
authorDr. Jaska <drjaska83@gmail.com>
Tue, 23 May 2023 05:28:17 +0000 (05:28 +0000)
committerDr. Jaska <drjaska83@gmail.com>
Tue, 23 May 2023 05:28:17 +0000 (05:28 +0000)
misc/tools/rsync-updater/README.txt
misc/tools/rsync-updater/update-to-autobuild.bat
misc/tools/rsync-updater/update-to-autobuild.sh
misc/tools/rsync-updater/update-to-release.bat

index 39d6881b161a1db8fe4afd8c511461c80a816f2c..0bf88feba1cc2a9a2afa65bbdebdf273d014f47a 100644 (file)
@@ -1,19 +1,24 @@
 Windows users:
 Windows users:
-Double click update-xonotic.bat and wait for the download to complete.
+Double click update-to-{build}.bat and wait for the download to complete.
 
 Linux/OSX users:
 
 Linux/OSX users:
-Change to this directory in a terminal, then run ./update-xonotic.sh and wait
+Change to this directory in a terminal, then run ./update-to-{build}.sh and wait
 for the download to complete.
 
 for the download to complete.
 
-Redoing this step at a later time will only download the changes since last
-time. Note that any changes inside the Xonotic directory will be overwritten.
+update-to-autobuild means updating to the latest nightly beta build of Xonotic.
+update-to-stable means updating to the latest stable release build of Xonotic.
+
+Redoing this step at a later time will only download the changes since last time.
+
+Note that any changes inside the Xonotic directory will be overwritten.
 Do your changes in the directory that has the config.cfg file!
 Do your changes in the directory that has the config.cfg file!
+By default those are:
+On Windows the "C:\users\%userprofile%\Saved Games\xonotic\data\" folder
+On Linux or Mac the "~/.xonotic/data/" directory
+
 
 
-Secret trick: if you create a directory Xonotic-low in this directory before
-running the updater (or later, if you rename the Xonotic directory the updater
-created to Xonotic-low), this script will download the low version of Xonotic.
-If you create a directory Xonotic-high in this directory before running the
-updater (or later, if you rename the Xonotic directory the updater created to
-Xonotic-high), it will download the HQ version! If none of the two exists, it
-will download regular Xonotic. Only one version of the game can be managed by
-this script.
+Secret trick: if you create any file/directory named "Xonotic-high"
+in this directory before running the updater, this script will
+download Xonotic with uncompressed textures. Otherwise it will
+download regular Xonotic. To change from Xonotic-high to regular
+create any file/directory named "Xonotic" and run the script again.
index 1fb8b2e235090e43fd122bf4e195e134dd77c8fb..bfa0b492191f36aad4b057b7e91fd7bedc74d666 100755 (executable)
@@ -18,24 +18,27 @@ if "%~n0" == "update-to-autobuild" set buildtype=autobuild
 \r
 set options=-Prtzil --executability --delete-after --delete-excluded --stats\r
 \r
 \r
 set options=-Prtzil --executability --delete-after --delete-excluded --stats\r
 \r
-if exist Xonotic-low goto xonoticlow\r
-if exist Xonotic-high goto xonotichigh\r
 if exist ..\..\..\.git goto xonoticdatagit\r
 if exist ..\..\..\.git goto xonoticdatagit\r
+if exist Xonotic goto xonoticswitchtonormal\r
+if exist Xonotic-high goto xonoticswitchtohigh\r
 if exist ..\..\..\data goto xonoticdata\r
 goto xonotic\r
 if exist ..\..\..\data goto xonoticdata\r
 goto xonotic\r
-:xonoticlow\r
-        echo NOTE: Xonotic-low is gone, downloading normal Xonotic.\r
-       set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
-       set target=Xonotic-low/\r
-       goto endxonotic\r
-:xonotichigh\r
-       set url=rsync://beta.xonotic.org/%buildtype%-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
 :xonoticdatagit\r
        echo NOTE: this is a git repository download. Using the regular update method.\r
        ..\..\..\all update\r
        goto end\r
+:xonoticswitchtohigh\r
+       set PATH=misc\tools\rsync-updater;%PATH%\r
+       cd ..\..\..\r
+       if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatahighfuzzy\r
+       echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
+       goto end\r
+:xonoticswitchtonormal\r
+       set PATH=misc\tools\rsync-updater;%PATH%\r
+       cd ..\..\..\r
+       if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatanormalfuzzy\r
+       echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
+       goto end\r
 :xonoticdata\r
        if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
        echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
 :xonoticdata\r
        if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
        echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
@@ -43,23 +46,12 @@ goto xonotic
 :xonoticdatarsync\r
        set PATH=misc\tools\rsync-updater;%PATH%\r
        cd ..\..\..\r
 :xonoticdatarsync\r
        set PATH=misc\tools\rsync-updater;%PATH%\r
        cd ..\..\..\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
        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
-               echo NOTE: Xonotic-low is gone, downloading normal Xonotic.\r
-               set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
-               goto endxonoticdata\r
-:xonoticdatalowfuzzy\r
-               echo NOTE: Xonotic-low is gone, downloading normal Xonotic.\r
-               set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
-               set options=%options% -y\r
-               goto endxonoticdata\r
 :xonoticdatahigh\r
                set url=rsync://beta.xonotic.org/%buildtype%-Xonotic-high/\r
                goto endxonoticdata\r
 :xonoticdatahigh\r
                set url=rsync://beta.xonotic.org/%buildtype%-Xonotic-high/\r
                goto endxonoticdata\r
index 32ce1f2a5e21d857445bd2da18cc80dc3d06f6bd..b07517924554cf178cd0d448b3cc20074d6425f9 100755 (executable)
@@ -1,17 +1,18 @@
 #!/bin/sh
 
 #!/bin/sh
 
-if [ -d "${0%/*}" ]; then
-       cd "${0%/*}"
-fi
+cd "${0%/*}" || exit 1
 
 
-if ! which rsync >/dev/null; then
+if ! which rsync > /dev/null; then
        echo >&2 "FATAL: rsync not found, please install the rsync package"
        exit 1
 fi
 
        echo >&2 "FATAL: rsync not found, please install the rsync package"
        exit 1
 fi
 
-[ "$1" = "-y" ] && choice=y
+if [ "$1" = "-y" ] || [ "$1" = "--yes" ]; then
+       choice=y
+fi
 until [ "$choice" = y ] || [ "$choice" = Y ]; do
 until [ "$choice" = y ] || [ "$choice" = Y ]; do
-       read -rp "This script will DELETE any custom files in the Xonotic folder. Do you want to continue [Y/N]? " choice
+       printf "This script will DELETE any custom files in the Xonotic folder. Do you want to continue [Y/N]? "
+       read -r choice
        [ "$choice" = n ] || [ "$choice" = N ] && exit 1
 done
 
        [ "$choice" = n ] || [ "$choice" = N ] && exit 1
 done
 
@@ -26,32 +27,38 @@ esac
 
 options="-Prtzil --executability --delete-after --delete-excluded --stats"
 
 
 options="-Prtzil --executability --delete-after --delete-excluded --stats"
 
-if [ -d "Xonotic-low" ]; then
-       echo NOTE: Xonotic-low is gone, downloading normal Xonotic.
-       url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
-       target="Xonotic-low/"
-elif [ -d "Xonotic-high" ]; then
-       url="rsync://beta.xonotic.org/$buildtype-Xonotic-high/"
-       target="Xonotic-high/"
-elif [ -d "../../../.git" ]; then
+if [ -d "../../../.git" ]; then
        echo >&2 "NOTE: this is a git repository download. Using the regular update method."
        exec ../../../all update
        echo >&2 "NOTE: this is a git repository download. Using the regular update method."
        exec ../../../all update
+elif [ -e "Xonotic" ]; then
+       echo "found manually created 'Xonotic' file"
+       echo "targetting the normal $buildtype version"
+       url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
+       target="../../.."
+       options="$options -y" # use fuzzy matching because file names may differ
+elif [ -e "Xonotic-high" ]; then
+       echo "found manually created 'Xonotic-high' file"
+       echo "targetting the high $buildtype version"
+       url="rsync://beta.xonotic.org/$buildtype-Xonotic-high/"
+       target="../../.."
+       options="$options -y" # use fuzzy matching because file names may differ
 elif [ -d "../../../data" ]; then
 elif [ -d "../../../data" ]; then
-       if [ -f ../../../data/xonotic-rsync-data-low.pk3 ]; then
-               echo NOTE: Xonotic-low is gone, downloading normal Xonotic.
-               url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
-       elif [ -f ../../../data/xonotic-*-data-low.pk3 ]; then
-               echo NOTE: Xonotic-low is gone, downloading normal Xonotic.
-               url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
-               options="$options -y" # use fuzzy matching because file names differ
-       elif [ -f ../../../data/xonotic-rsync-data-high.pk3 ]; then
+       if [ -f ../../../data/xonotic-rsync-data-high.pk3 ]; then
+               echo "found rsync high data files"
+               echo "targetting the high $buildtype version"
                url="rsync://beta.xonotic.org/$buildtype-Xonotic-high/"
        elif [ -f ../../../data/xonotic-*-data-high.pk3 ]; then
                url="rsync://beta.xonotic.org/$buildtype-Xonotic-high/"
        elif [ -f ../../../data/xonotic-*-data-high.pk3 ]; then
+               echo "found release high data files"
+               echo "targetting the high $buildtype version"
                url="rsync://beta.xonotic.org/$buildtype-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/$buildtype-Xonotic-high/"
                options="$options -y" # use fuzzy matching because file names differ
        elif [ -f ../../../data/xonotic-rsync-data.pk3 ]; then
+               echo "found Xonotic rsync data files"
+               echo "targetting the normal $buildtype version"
                url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
        elif [ -f ../../../data/xonotic-*-data.pk3 ]; then
                url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
        elif [ -f ../../../data/xonotic-*-data.pk3 ]; then
+               echo "found Xonotic release data files"
+               echo "targetting the normal $buildtype version"
                url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
                options="$options -y" # use fuzzy matching because file names differ
        else
                url="rsync://beta.xonotic.org/$buildtype-Xonotic/"
                options="$options -y" # use fuzzy matching because file names differ
        else
@@ -67,25 +74,27 @@ fi
 excludes=
 if [ -z "$XONOTIC_INCLUDE_ALL" ]; then
        excludes="$excludes --exclude=/*.exe"
 excludes=
 if [ -z "$XONOTIC_INCLUDE_ALL" ]; then
        excludes="$excludes --exclude=/*.exe"
-       excludes="$excludes --exclude=/gmqcc/*.exe"
        excludes="$excludes --exclude=/bin32"
        excludes="$excludes --exclude=/*.dll"
        excludes="$excludes --exclude=/bin64"
 
        excludes="$excludes --exclude=/bin32"
        excludes="$excludes --exclude=/*.dll"
        excludes="$excludes --exclude=/bin64"
 
-       case `uname`:`uname -m` in
+       case $(uname):$(uname -m) in
                Darwin:*)
                        excludes="$excludes --exclude=/xonotic-linux*"
                Darwin:*)
                        excludes="$excludes --exclude=/xonotic-linux*"
-                       excludes="$excludes --exclude=/gmqcc/gmqcc.linux*"
                        ;;
                Linux:x86_64)
                        excludes="$excludes --exclude=/Xonotic*.app"
                        excludes="$excludes --exclude=/xonotic-osx-*"
                        ;;
                Linux:x86_64)
                        excludes="$excludes --exclude=/Xonotic*.app"
                        excludes="$excludes --exclude=/xonotic-osx-*"
-                       excludes="$excludes --exclude=/gmqcc/gmqcc.osx"
-                       excludes="$excludes --exclude=/xonotic-linux32-*"
-                       excludes="$excludes --exclude=/gmqcc/gmqcc.linux32"
                        ;;
                *)
                        ;;
                *)
-                       echo >&2 "WARNING: Could not detect architecture - downloading all architectures"
+                       printf >&2 "\e[1;31m"
+                       printf >&2 "WARNING: Could not detect architecture\n"
+                       printf >&2 "WARNING: Xonotic does NOT provide pre-built %s executables\n" "$(uname):$(uname -m)"
+                       printf >&2 "WARNING: Please run make. More info is available at\n"
+                       printf >&2 "WARNING: \e[1;36mhttps://gitlab.com/xonotic/xonotic/-/wikis/Compiling\e[m\n"
+                       excludes="$excludes --exclude=/Xonotic*.app"
+                       excludes="$excludes --exclude=/xonotic-osx-*"
+                       excludes="$excludes --exclude=/xonotic-linux64-*"
                        ;;
        esac
 fi
                        ;;
        esac
 fi
index 10126a6a38ac5e3b76618dc4c84e60347019d9ff..e2c2119524c21c3d0722b1d8892c09ca39a286b3 100755 (executable)
@@ -18,24 +18,27 @@ if "%~n0" == "update-to-autobuild" set buildtype=autobuild
 \r
 set options=-Prtzil --executability --delete-after --delete-excluded --stats\r
 \r
 \r
 set options=-Prtzil --executability --delete-after --delete-excluded --stats\r
 \r
-if exist Xonotic-low goto xonoticlow\r
-if exist Xonotic-high goto xonotichigh\r
 if exist ..\..\..\.git goto xonoticdatagit\r
 if exist ..\..\..\data goto xonoticdata\r
 if exist ..\..\..\.git goto xonoticdatagit\r
 if exist ..\..\..\data goto xonoticdata\r
+if exist Xonotic goto xonoticswitchtonormal\r
+if exist Xonotic-high goto xonoticswitchtohigh\r
 goto xonotic\r
 goto xonotic\r
-:xonoticlow\r
-        echo NOTE: Xonotic-low is gone, downloading normal Xonotic.\r
-       set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
-       set target=Xonotic-low/\r
-       goto endxonotic\r
-:xonotichigh\r
-       set url=rsync://beta.xonotic.org/%buildtype%-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
 :xonoticdatagit\r
        echo NOTE: this is a git repository download. Using the regular update method.\r
        ..\..\..\all update\r
        goto end\r
+:xonoticswitchtohigh\r
+       set PATH=misc\tools\rsync-updater;%PATH%\r
+       cd ..\..\..\r
+       if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatahighfuzzy\r
+       echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
+       goto end\r
+:xonoticswitchtonormal\r
+       set PATH=misc\tools\rsync-updater;%PATH%\r
+       cd ..\..\..\r
+       if exist misc\tools\rsync-updater\rsync.exe goto xonoticdatanormalfuzzy\r
+       echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
+       goto end\r
 :xonoticdata\r
        if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
        echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
 :xonoticdata\r
        if exist ..\..\..\misc\tools\rsync-updater\rsync.exe goto xonoticdatarsync\r
        echo FATAL: rsync not in misc\tools\rsync-updater. This update script cannot be used.\r
@@ -43,23 +46,12 @@ goto xonotic
 :xonoticdatarsync\r
        set PATH=misc\tools\rsync-updater;%PATH%\r
        cd ..\..\..\r
 :xonoticdatarsync\r
        set PATH=misc\tools\rsync-updater;%PATH%\r
        cd ..\..\..\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
        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
-               echo NOTE: Xonotic-low is gone, downloading normal Xonotic.\r
-               set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
-               goto endxonoticdata\r
-:xonoticdatalowfuzzy\r
-               echo NOTE: Xonotic-low is gone, downloading normal Xonotic.\r
-               set url=rsync://beta.xonotic.org/%buildtype%-Xonotic/\r
-               set options=%options% -y\r
-               goto endxonoticdata\r
 :xonoticdatahigh\r
                set url=rsync://beta.xonotic.org/%buildtype%-Xonotic-high/\r
                goto endxonoticdata\r
 :xonoticdatahigh\r
                set url=rsync://beta.xonotic.org/%buildtype%-Xonotic-high/\r
                goto endxonoticdata\r