]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/tools/rsync-updater/update-xonotic.sh
4cd2af226354630f47fa541e26b271d8b6343164
[xonotic/xonotic.git] / misc / tools / rsync-updater / update-xonotic.sh
1 #!/bin/sh
2
3 if ! which rsync >/dev/null; then
4         echo >&2 "FATAL: rsync not found, please install the rsync package"
5         exit 1
6 fi
7
8 options="-Prtzil --executability --delete-after --delete-excluded --stats"
9
10 if [ -d "Xonotic-low" ]; then
11         url="rsync://beta.xonotic.org/autobuild-Xonotic-low/"
12         target="Xonotic-low/"
13 elif [ -d "Xonotic-high" ]; then
14         url="rsync://beta.xonotic.org/autobuild-Xonotic-high/"
15         target="Xonotic-high/"
16 else
17         url="rsync://beta.xonotic.org/autobuild-Xonotic/"
18         target="Xonotic/"
19 fi
20
21 excludes=
22 excludes="$excludes --exclude=/*.exe"
23 excludes="$excludes --exclude=/fteqcc/*.exe"
24 excludes="$excludes --exclude=/bin32"
25 excludes="$excludes --exclude=/*.dll"
26 excludes="$excludes --exclude=/bin64"
27
28 case `uname`:`uname -m` in
29         Darwin:*)
30                 excludes="$excludes --exclude=/xonotic-linux*"
31                 excludes="$excludes --exclude=/fteqcc/fteqcc.linux*"
32                 ;;
33         Linux:x86_64)
34                 excludes="$excludes --exclude=/Xonotic*.app"
35                 excludes="$excludes --exclude=/xonotic-osx-*"
36                 excludes="$excludes --exclude=/fteqcc/fteqcc.osx"
37                 excludes="$excludes --exclude=/xonotic-linux32-*"
38                 excludes="$excludes --exclude=/fteqcc/fteqcc.linux32"
39                 ;;
40         Linux:i?86)
41                 excludes="$excludes --exclude=/Xonotic*.app"
42                 excludes="$excludes --exclude=/xonotic-osx-*"
43                 excludes="$excludes --exclude=/fteqcc/fteqcc.osx"
44                 excludes="$excludes --exclude=/xonotic-linux64-*"
45                 excludes="$excludes --exclude=/fteqcc/fteqcc.linux64"
46                 ;;
47         *)
48                 echo >&2 "WARNING: Could not detect architecture - downloading all architectures"
49                 ;;
50 esac
51
52 rsync $options $excludes "$url" "$target"