6 while ! [ -f ./all ]; do
7 if [ x"`pwd`" = x"/" ]; then
8 echo "Cannot find myself."
9 echo "Please run this script with the working directory inside a Xonotic checkout."
17 # If we are on WINDOWS:
22 # Windows hates users. So this script has to copy itself elsewhere first...
24 cp "$SELF" ../all.xonotic.sh
25 exec ../all.xonotic.sh "$@"
38 if [ -x /usr/bin/md5sum ]; then
40 elif [ -x /bin/md5sum ]; then
42 elif [ -x /usr/bin/cksum ]; then
49 self=`checksum "$SELF"`
52 self_new=`checksum "$SELF"`
53 if [ x"$self" != x"$self_new" ]; then
54 msg "./all has changed."
55 if [ -z "$XONOTIC_FORBID_RERUN_ALL" ]; then
56 msg "Rerunning the requested operation to make sure."
57 export XONOTIC_FORBID_RERUN_ALL=1
60 msg "Please try $SELF update, and then retry your requested operation."
75 data/xonotic-data.pk3dir
76 data/xonotic-maps.pk3dir
77 data/xonotic-music.pk3dir
78 data/xonotic-nexcompat.pk3dir
80 fteqcc@git://github.com/Blub/qclib.git
81 div0-gittools@git://git.icculus.org/divverent/div0-gittools.git
85 repos=`for X in $repos_urls; do echo "${X%%@*}"; done`
95 base=`git config remote.origin.url`
96 base=${base%xonotic.git}
97 for dcomplete in $repos_urls; do
106 url=$base${d##*/}.git
110 if [ -d "$d0/$d" ]; then
117 verbose git config remote.origin.url "$url"
121 verbose git pull || true # errors if the branch is not tracking anything
123 checkself "$SELF" "$@"
125 verbose git remote prune origin
128 verbose git clone "$url" "$d0/$d"
135 if [ -z "$branch" ]; then
142 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
144 verbose git checkout "$branch"
145 elif git rev-parse "refs/remotes/$remote/$branch" >/dev/null 2>&1; then
147 verbose git checkout --track -b "$branch" "$remote/$branch"
149 verbose git checkout master
152 checkself "$SELF" "$@"
156 echo "The requested branch was not found in any repository."
163 if [ -z "$branch" ]; then
167 if [ -z "$branch" ]; then
170 r=`git symbolic-ref HEAD`
179 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
180 echo "Branch in \"$d\"?"
183 if [ x"$a" = x"y" ]; then
184 verbose git push "$remote" HEAD:"$branch"
185 verbose git checkout --track -b "$branch" "$remote/$branch"
196 git branch -a | sed 's/^/ /; /->/d'
203 r=`git symbolic-ref HEAD`
205 if git log HEAD..origin/master | grep .; then
206 # we have uncommitted changes
208 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
209 echo "Could merge from \"master\" into \"$r\" in \"$d\". Do it?"
212 if [ x"$a" = x"y" ]; then
213 if ! verbose git merge origin/master; then
215 echo "MERGE CONFLICT."
216 echo "change into the \"$d\" project directory, and then:"
217 echo "- edit the files mentioned above with your favorite editor,"
218 echo " and fix the conflicts (marked with <<<<<<< blocks)"
219 echo "- when done with a file, 'git add' the file"
220 echo "- when done, 'git commit'"
231 r=`git symbolic-ref HEAD`
233 if git diff HEAD | grep .; then
234 # we have uncommitted changes
236 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
237 echo "Uncommitted changes in \"$r\" in \"$d\". Commit?"
240 if [ x"$a" = x"y" ]; then
241 verbose git commit -a
244 if git log "origin/$r".."$r" | grep .; then
246 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
247 echo "Push \"$r\" in \"$d\"?"
250 if [ x"$a" = x"y" ]; then
251 verbose git push `git config "branch.$r.remote" || echo origin` HEAD
258 if [ -z "$MAKEFLAGS" ]; then
259 if [ -f /proc/cpuinfo ]; then
260 ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
261 if [ $ncpus -gt 1 ]; then
266 verbose cd "$d0/fteqcc"
267 verbose make $MAKEFLAGS
268 verbose cd "$d0/data/xonotic-data.pk3dir"
269 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" $MAKEFLAGS
270 verbose cd "$d0/darkplaces"
271 verbose make $MAKEFLAGS sv-debug
272 verbose make $MAKEFLAGS cl-debug
273 verbose make $MAKEFLAGS sdl-debug
278 sdl|glx|agl|dedicated)
287 if ! [ -x "darkplaces/darkplaces$client" ]; then
288 if [ -x "darkplaces/darkplaces$client.exe" ]; then
291 echo "Client darkplaces/darkplaces$client not found, aborting"
295 #verbose "darkplaces/darkplaces$client" -xonotic "$@"
296 verbose "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic "$@"
310 echo " $SELF branches"
311 echo " $SELF branch [<remote>] <branchname>"
312 echo " $SELF checkout [<remote>] <branchname>"
313 echo " $SELF compile"
314 echo " $SELF run <client> <options>"
315 echo " $SELF each <command>"