]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/rsync-updater/update-xonotic.sh
rsync updater: add support for running from inside the xonotic directory
[xonotic/xonotic.git] / misc / tools / rsync-updater / update-xonotic.sh
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/"