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 if git ls-files -u | grep ' 1 '; then
77 echo "MERGE CONFLICT."
78 echo "change into the \"$1\" project directory, and then:"
79 echo "- edit the files mentioned above with your favorite editor,"
80 echo " and fix the conflicts (marked with <<<<<<< blocks)"
81 echo "- for binary files, you can select the files using"
82 echo " git checkout --ours or git checkout --theirs"
83 echo "- when done with a file, 'git add' the file"
84 echo "- when done, 'git commit'"
93 check_mergeconflict "$1"
98 data/xonotic-data.pk3dir
99 data/xonotic-maps.pk3dir
100 data/xonotic-music.pk3dir
101 data/xonotic-nexcompat.pk3dir
103 fteqcc@git://github.com/Blub/qclib.git
104 div0-gittools@git://git.icculus.org/divverent/div0-gittools.git
108 repos=`for X in $repos_urls; do echo "${X%%@*}"; done`
110 if [ "$#" = 0 ]; then
118 base=`git config remote.origin.url`
119 base=${base%xonotic.git}
120 for dcomplete in $repos_urls; do
129 url=$base${d##*/}.git
133 if [ -d "$d0/$d" ]; then
140 verbose git config remote.origin.url "$url"
144 if ! verbose git pull; then
145 check_mergeconflict "$d"
146 # do not exit, as this may also mean we are tracking something else
149 checkself "$SELF" "$@"
151 verbose git remote prune origin
154 verbose git clone "$url" "$d0/$d"
161 if [ -z "$branch" ]; then
168 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
170 verbose git checkout "$branch"
171 elif git rev-parse "refs/remotes/$remote/$branch" >/dev/null 2>&1; then
173 verbose git checkout --track -b "$branch" "$remote/$branch"
175 verbose git checkout master
178 checkself "$SELF" "$@"
182 echo "The requested branch was not found in any repository."
189 if [ -z "$branch" ]; then
193 if [ -z "$branch" ]; then
196 r=`git symbolic-ref HEAD`
205 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
206 echo "Branch in \"$d\"?"
209 if [ x"$a" = x"y" ]; then
210 verbose git push "$remote" HEAD:"$branch"
211 verbose git checkout --track -b "$branch" "$remote/$branch"
222 git branch -a | sed 's/^/ /; /->/d'
229 r=`git symbolic-ref HEAD`
231 if git log HEAD..origin/master | grep .; then
232 # we have uncommitted changes
234 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
235 echo "Could merge from \"master\" into \"$r\" in \"$d\". Do it?"
238 if [ x"$a" = x"y" ]; then
239 if ! verbose git merge origin/master; then
240 check_mergeconflict "$d"
241 exit 1 # this should ALWAYS be fatal
251 r=`git symbolic-ref HEAD`
253 if git diff HEAD | grep .; then
254 # we have uncommitted changes
256 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
257 echo "Uncommitted changes in \"$r\" in \"$d\". Commit?"
260 if [ x"$a" = x"y" ]; then
261 verbose git commit -a
264 if git log "origin/$r".."$r" | grep .; then
266 while [ x"$a" != x"y" -a x"$a" != x"n" ]; do
267 echo "Push \"$r\" in \"$d\"?"
270 if [ x"$a" = x"y" ]; then
271 verbose git push `git config "branch.$r.remote" || echo origin` HEAD
278 if [ -z "$MAKEFLAGS" ]; then
279 if [ -f /proc/cpuinfo ]; then
280 ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
281 if [ $ncpus -gt 1 ]; then
287 verbose make $MAKEFLAGS
288 enter "$d0/data/xonotic-data.pk3dir"
289 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" $MAKEFLAGS
290 enter "$d0/darkplaces"
291 verbose make $MAKEFLAGS sv-debug
292 verbose make $MAKEFLAGS cl-debug
293 verbose make $MAKEFLAGS sdl-debug
298 sdl|glx|agl|dedicated)
307 if ! [ -x "darkplaces/darkplaces$client" ]; then
308 if [ -x "darkplaces/darkplaces$client.exe" ]; then
311 echo "Client darkplaces/darkplaces$client not found, aborting"
315 #verbose "darkplaces/darkplaces$client" -xonotic "$@"
316 verbose "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic "$@"
330 echo " $SELF branches"
331 echo " $SELF branch [<remote>] <branchname>"
332 echo " $SELF checkout [<remote>] <branchname>"
333 echo " $SELF compile"
334 echo " $SELF run <client> <options>"
335 echo " $SELF each <command>"