5 if [ -n "$ZSH_VERSION" ]; then
8 if [ -z "$ECHO" ]; then
9 if echo "\\\\" | grep .. >/dev/null; then
16 # I use this in EVERY shell script ;)
22 while ! [ -f ./all ]; do
23 if [ x"`pwd`" = x"/" ]; then
24 $ECHO "Cannot find myself."
25 $ECHO "Please run this script with the working directory inside a Xonotic checkout."
33 # If we are on WINDOWS:
38 # Windows hates users. So this script has to copy itself elsewhere first...
39 cp "$SELF" ../all.xonotic.sh
40 export WE_HATE_OUR_USERS=1
41 exec ../all.xonotic.sh "$@"
49 $ECHO >&2 "$ESC""[1m$*$ESC""[m"
52 self=`git hash-object "$SELF"`
55 self_new=`git hash-object "$SELF"`
56 if [ x"$self" != x"$self_new" ]; then
57 msg "./all has changed."
58 if [ -z "$XONOTIC_FORBID_RERUN_ALL" ]; then
59 msg "Rerunning the requested operation to make sure."
60 export XONOTIC_FORBID_RERUN_ALL=1
63 msg "Please try $SELF update, and then retry your requested operation."
80 $ECHO "the root directory"
90 if git ls-files -u | grep ' 1 '; then
92 $ECHO "MERGE CONFLICT."
93 $ECHO "change into the \"$1\" project directory, and then:"
94 $ECHO "- edit the files mentioned above with your favorite editor,"
95 $ECHO " and fix the conflicts (marked with <<<<<<< blocks)"
96 $ECHO "- for binary files, you can select the files using"
97 $ECHO " git checkout --ours or git checkout --theirs"
98 $ECHO "- when done with a file, 'git add' the file"
99 $ECHO "- when done, 'git commit'"
108 while [ x"$yesno" != x"y" -a x"$yesno" != x"n" ]; do
111 if ! IFS= read -r yesno; then
122 check_mergeconflict "$1"
127 data/xonotic-data.pk3dir | | master |
128 data/xonotic-music.pk3dir | | master |
129 data/xonotic-nexcompat.pk3dir | | master | no
130 darkplaces | | div0-stable | svn
131 netradiant | | master |
132 div0-gittools | | master | no
133 d0_blind_id | | master |
134 data/xonotic-maps.pk3dir | | master |
135 mediasource | | master | no
136 fteqcc | | xonotic-stable | noautocrlf
138 # todo: in darkplaces, change repobranch to div0-stable
140 repos=`$ECHO "$repos_urls" | grep . | cut -d '|' -f 1 | tr -d ' '`
142 base=`git config remote.origin.url`
145 base=${base%xonotic.git}
148 $ECHO "The main repo is not xonotic.git, what have you done?"
152 pushbase=`git config remote.origin.pushurl || true`
155 pushbase=${pushbase%xonotic.git}
160 $ECHO "The main repo is not xonotic.git, what have you done?"
167 repo_t=`$ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
168 if [ -n "$repo_t" ]; then
178 if [ x"$1" = x"." ]; then
179 $ECHO "$base""xonotic.git"
181 $ECHO "$base${1##*/}.git"
188 [ -n "$pushbase" ] || return 0
189 repo_t=`$ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
190 if [ -n "$repo_t" ]; then
195 $ECHO "$pushbase$repo_t"
199 if [ x"$1" = x"." ]; then
200 $ECHO "$pushbase""xonotic.git"
202 $ECHO "$pushbase${1##*/}.git"
209 repo_t=`$ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 3 | tr -d ' '`
210 if [ -n "$repo_t" ]; then
219 $ECHO "$repos_urls" | grep "^$1 " | cut -d '|' -f 4 | tr -d ' '
227 # if we have the dir, always keep it
229 msg "Repository $d enabled because it already exists"
233 # if .yes file exists, always keep it
234 if [ -f "$d.yes" ]; then
235 msg "Repository $d enabled by a .yes file"
239 # if we have .no file, skip
240 if [ -f "$d.no" ]; then
241 msg "Repository $d disabled by a .no file, delete $d.no to enable"
244 # if we have matching pk3, skip
245 if [ x"$p" != x"$d" ] && [ -f "$p" ]; then
246 msg "Repository $d disabled by matching .pk3 file, delete $p or create $d.yes to enable"
249 # if "no" flag is set, skip
252 msg "Repository $d disabled by default, create $d.yes to enable"
257 msg "Repository $d enabled by default"
264 if [ "$#" = 0 ]; then
270 fix_upstream_rebase()
272 if [ -z "$r_me" ] || [ -z "$r_other" ]; then
276 # one of the two sides of the merge should be remote upstream, or all is fine
277 r_r=`git symbolic-ref HEAD`
278 r_r=${r_r#refs/heads/}
279 r_rem=`git config "branch.$r_rem.remote" || $ECHO origin`
280 r_bra=`git config "branch.$r_bra.merge" || $ECHO "$r_r"`
281 r_bra=${r_bra#refs/heads/}
282 if [ x"$r_me" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then
283 if [ x"$r_other" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then
288 r_base=`git merge-base "$r_me" "$r_other"`
290 # no merge-base? upstream did filter-branch
291 if [ -n "$r_base" ]; then
292 # otherwise, check if the two histories are "similar"
293 r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
294 r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
296 # heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
297 r_lc_me=`$ECHO "$r_l_me" | wc -l`
298 r_lc_other=`$ECHO "$r_l_other" | wc -l`
299 r_lc_together=`{ $ECHO "$r_l_me"; $ECHO "$r_l_other"; } | sort -u | wc -l`
300 r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
302 if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
303 if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
304 git reset --hard "$r_me"
314 fix_upstream_rebase_mergeok()
316 r_me=`git rev-parse --revs-only HEAD^1 2>/dev/null || true`
317 r_other=`git rev-parse --revs-only HEAD^2 2>/dev/null || true`
321 fix_upstream_rebase_mergefail()
323 r_me=`git rev-parse --revs-only HEAD 2>/dev/null || true`
324 r_other=`git rev-parse --revs-only MERGE_HEAD 2>/dev/null || true`
330 verbose git config remote.origin.url "$1"
332 verbose git config remote.origin.pushurl "$2"
334 verbose git config --unset remote.origin.pushurl || true
336 verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
337 case ",`repoflags "$d"`," in
339 verbose git config --unset core.autocrlf || true
342 verbose git config core.autocrlf input
345 if [ -z "`git config push.default || true`" ]; then
346 verbose git config push.default current # or is tracking better?
348 verbose git config filter.mapclean.clean "tr -d '\r' | grep '^[^/]'"
349 verbose git config filter.mapclean.smudge "cat"
357 find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
358 7za a -tzip -mx=9 -x@"$ziplist" "$archive" "$@" || true
359 zip -9y -@<"$ziplist" "$archive" || true
370 # first result is to be ignored, but we use it to check status
371 git ls-remote "$1" refs/heads/master >/dev/null 2>&1 || return 1
372 { time -p git ls-remote "$1" refs/heads/master; } 2>&1 >/dev/null | head -n 1 | cut -d ' ' -f 2 | tr -d . | sed 's,^0*,,'
373 # unit: clock ticks (depends on what "time" returns
381 if ! { time -p true; } >/dev/null 2>&1; then
399 if t=`mirrorspeed "$m"`; then
401 tt=$(($t$op)) # fudge factor
402 msg "$m -> $t$op = $tt ticks"
403 if [ -z "$bestt" ] || [ "$tt" -lt "$bestt" ]; then
414 if [ -n "$bestin" ]; then
415 msg "Best mirror seems to be $pre$bestin$suf"
425 enter "$d0/$d" verbose
426 verbose fix_upstream_rebase_mergefail && verbose fix_upstream_rebase_mergeok
432 pushurl=`repopushurl "$d"`
433 branch=`repobranch "$d"`
434 if [ -d "$d0/$d" ]; then
436 fix_git_config "$url" "$pushurl"
442 # enable the ssh URL for pushing
445 if [ -f ~/.ssh/id_rsa.pub ]; then
447 msg "A key already exists and no new one will be generated. If you"
448 msg "already have done the procedure for getting your key approved, you"
449 msg "can skip the following paragraph and already use the repository."
451 msg "To get access, your key has to be approved first. For that, visit"
452 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
453 msg "the \"Support\" tracker in the \"Repository\" category where you"
454 msg "apply for access and paste the following output into the issue:"
456 msg "`cat ~/.ssh/id_rsa.pub`"
458 msg "Note that you will only have write access to branches that start"
459 msg "with your user name."
460 elif [ -f ~/.ssh/id_dsa.pub ]; then
462 msg "A key already exists and no new one will be generated. If you"
463 msg "already have done the procedure for getting your key approved, you"
464 msg "can skip the following paragraph and already use the repository."
466 msg "To get access, your key has to be approved first. For that, visit"
467 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
468 msg "the \"Support\" tracker in the \"Repository\" category where you"
469 msg "apply for access and paste the following output into the issue:"
471 msg "`cat ~/.ssh/id_dsa.pub`"
473 msg "Note that you will only have write access to branches that start"
474 msg "with your user name."
477 msg "No key has been generated yet. One will be generated now."
478 msg "If other people are using your computer, it is recommended"
479 msg "to specify a passphrase. Otherwise you can simply hit ENTER"
480 msg "when asked for a passphrase."
482 ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa
484 msg "To get access, your key has to be approved first. For that, visit"
485 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
486 msg "the \"Support\" tracker in the \"Repository\" category where you"
487 msg "apply for access and paste the following output into the issue:"
489 msg "`cat ~/.ssh/id_rsa.pub`"
491 msg "Note that you will only have write access to branches that start"
492 msg "with your user name."
500 if [ x"$1" = x"-N" ]; then
502 elif [ x"$1" = x"-p" ]; then
504 pushbase=ssh://xonotic@git.xonotic.org/
505 elif [ x"$1" = x"-ps" ]; then
507 pushbase=ssh://xonotic@git.xonotic.org/
508 elif [ x"$1" = x"-ph" ]; then
510 pushbase=http://git.xonotic.org/login/xonotic/
511 elif [ x"$1" = x"-s" ]; then
513 base=ssh://xonotic@git.xonotic.org/
514 elif [ x"$1" = x"-g" ]; then
516 base=git://git.xonotic.org/xonotic/
517 elif [ x"$1" = x"-h" ]; then
519 base=http://git.xonotic.org/xonotic/
520 elif [ x"$1" = x"-l" ]; then
528 msg "Invalid location!"
529 msg "Possible locations for the -l option:"
530 msg " nl (Netherlands, run by merlijn)"
531 msg " de (Germany, run by divVerent)"
532 msg " us (United States of America, run by detrate)"
533 msg " best (find automatically)"
534 msg " default (currently nl)"
548 if [ x"`git config xonotic.all.mirrorselection 2>/dev/null || true`" != x"done" ]; then
549 git config xonotic.all.mirrorselection done
556 # if we fetched via ssh://, switch to git:// for fetching and keep using ssh:// for pushing
560 base=git://git.xonotic.org/xonotic/
563 newbase=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,:// .git.xonotic.org/,"`
566 if location=`bestmirror $newbase"xonotic.git" de us nl:'*6/5'`; then # 20% malus to the NL server to not overload it too much
584 *://*.git.xonotic.org/*)
585 location=${base%%.git.xonotic.org/*}
586 location=${location##*://}
594 if [ -n "$location" ]; then
595 base=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,://$location.git.xonotic.org/,"`
596 pushbase=`$ECHO "$pushbase" | sed "s,://\(.*\.\)\?git.xonotic.org/,://$location.git.xonotic.org/,"`
598 base=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,://git.xonotic.org/,"`
599 pushbase=`$ECHO "$pushbase" | sed "s,://\(.*\.\)\?git.xonotic.org/,://git.xonotic.org/,"`
603 pushurl=`repopushurl .`
604 fix_git_config "$url" "$pushurl"
606 if $allow_pull || $fix_config; then
611 pushurl=`repopushurl "$d"`
612 branch=`repobranch "$d"`
613 if [ -d "$d0/$d" ]; then
614 # if we have .no file, skip
615 if [ -f "$d0/$d.no" ]; then
616 msg "Repository $d disabled by a .no file, delete $d.no to enable; thus, not updated"
620 enter "$d0/$d" verbose
621 r=`git symbolic-ref HEAD`
623 if git config branch.$r.remote >/dev/null 2>&1; then
624 if ! verbose git pull; then
625 fix_upstream_rebase_mergefail || true
626 check_mergeconflict "$d"
627 $ECHO "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
630 fix_upstream_rebase_mergeok || true
635 checkself "$cmd" "$@"
637 verbose git remote prune origin
641 verbose git clone "$url" "$d0/$d"
642 enter "$d0/$d" verbose
643 fix_git_config "$url" "$pushurl"
644 if [ "$branch" != "master" ]; then
645 verbose git checkout --track -b "$branch" origin/"$branch"
652 misc/tools/xonotic-map-compiler-autobuild download
656 if [ x"$1" = x"-f" ]; then
662 if [ -z "$branch" ]; then
665 branch=${remote#origin/}
674 if [ -n "$checkoutflags" ]; then
675 set -- -f "$@" # to make checkself work again
679 enter "$d0/$d" verbose
681 if [ -n "$b" ] && git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
683 verbose git checkout $checkoutflags "$b"
684 elif [ -n "$b" ] && git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
686 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
689 if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
691 verbose git checkout $checkoutflags "$b"
692 elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
694 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
696 $ECHO "WTF? Not even branch $b doesn't exist in $d"
701 checkself "$cmd" "$@"
705 $ECHO "The requested branch was not found in any repository."
713 if [ -z "$branch" ]; then
717 if [ -z "$branch" ]; then
720 r=`git symbolic-ref HEAD`
727 dv=`visible_repo_name "$d"`
728 enter "$d0/$d" verbose
729 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
730 $ECHO "Already having this branch in $dv."
732 if yesno "Branch in $dv?"; then
733 if [ -n "$srcbranch" ]; then
736 b=origin/"`repobranch "$d"`"
737 verbose git fetch origin || true
739 # TODO do this without pushing
740 verbose git checkout -b "$branch" "$b"
741 verbose git config "branch.$branch.remote" "$remote"
742 verbose git config "branch.$branch.merge" "refs/heads/$branch"
752 cd "$d0/$d" # am in a pipe, shouldn't use enter
753 git branch -r -v -v | cut -c 3- | sed "s/^(no branch)/(no_branch)/" | sed "s,^,$d ,"
758 while read -r d BRANCH REV TEXT; do
759 if [ x"$BRANCH" = x"`repobranch "$d"`" ]; then
762 if [ x"$REV" = x"->" ]; then
765 BRANCH=${BRANCH#remotes/}
766 ID=`$ECHO "$BRANCH" | tr -c "A-Za-z0-9." "_"`
767 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
768 eval "r=\$branches_repos_$ID"
770 eval "branches_repos_$ID=\$r"
772 $ECHO -n "$branches_list" | xargs -n 1 $ECHO | sort -u | while IFS= read -r BRANCH; do
773 ID=`$ECHO "$BRANCH" | tr -c "A-Za-z0-9." "_"`
774 eval "r=\$branches_repos_$ID"
775 printf "%-60s %s\n" "$BRANCH" "$r"
782 dv=`visible_repo_name "$d"`
783 enter "$d0/$d" verbose
784 r=`git symbolic-ref HEAD`
786 if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
787 # we have uncommitted changes
788 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
789 if ! verbose git merge origin/"`repobranch "$d"`"; then
790 check_mergeconflict "$d"
791 exit 1 # this should ALWAYS be fatal
801 dv=`visible_repo_name "$d"`
802 enter "$d0/$d" verbose
803 r=`git symbolic-ref HEAD`
805 diffdata=`git diff --color HEAD`
806 if [ -n "$diffdata" ]; then
807 # we have uncommitted changes
808 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?" '$ECHO "$diffdata" | less -r'; then
809 verbose git commit -a
812 rem=`git config "branch.$r.remote" || $ECHO origin`
813 bra=`git config "branch.$r.merge" || $ECHO "$r"`
814 upstream="$rem/${bra#refs/heads/}"
815 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
816 upstream="origin/`repobranch "$d"`"
818 logdata=`git log --color "$upstream".."$r"`
819 if [ -n "$logdata" ]; then
820 if yesno "Push \"$r\" in $dv?" '$ECHO "$logdata" | less -r'; then
821 verbose git push "$rem" HEAD
824 if [ x"$submit" = x"-s" ]; then
827 verbose git push "$rem" HEAD:"${bra%%/*}/finished/${bra#*/}"
841 snowleopardhack=false
842 if [ -z "$CC" ]; then
843 export CC="gcc -DSUPPORTIPV6"
861 case "`$CC -dumpversion`" in
862 [5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
864 # -march=native is broken < 4.3
865 export CC="$CC -mtune=native -march=native"
868 if [ -n "$WE_HATE_OUR_USERS" ]; then
869 export CC="$CC -fno-common"
878 if [ -n "$WE_HATE_OUR_USERS" ]; then
879 TARGETS="sv-$debug cl-$debug"
880 elif [ x"`uname`" = x"Darwin" ]; then
883 TARGETS="sv-$debug cl-$debug sdl-$debug"
886 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
888 TARGETS="sv-$debug sdl-$debug"
891 export CC="$CC -fno-reorder-blocks -I$PWD/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks/SDL.framework/Headers -F$PWD/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
893 TARGETS="sv-$debug cl-$debug sdl-$debug"
895 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
896 # if we give the command make the arg "", it will surely fail (invalid filename),
897 # so better handle it as an empty client option
900 elif [ -n "$1" ]; then
902 TARGETS_SAVE=$TARGETS
907 TARGETS="$TARGETS sdl-debug"
910 TARGETS="$TARGETS cl-debug"
911 if $snowleopardhack; then
912 export CC="$CC -arch i386"
916 TARGETS="$TARGETS cl-debug"
919 TARGETS="$TARGETS sv-debug"
922 BAD_TARGETS="$BAD_TARGETS $X"
926 if [ -n "$TARGETS" ]; then # at least a valid client
928 else # no valid client, let's assume this option is not meant to be a client then
929 TARGETS=$TARGETS_SAVE
933 if [ -z "$MAKEFLAGS" ]; then
934 if [ -f /proc/cpuinfo ]; then
935 ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
936 if [ $ncpus -gt 1 ]; then
940 if [ -n "$WE_HATE_OUR_USERS" ]; then
941 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw LIB_JPEG= CFLAGS_LIBJPEG="
945 verbose cd "$d0/d0_blind_id"
946 if ! $compiled0; then
947 # compilation of crypto library failed
948 # use binaries then, if we can...
950 if [ -n "$WE_HATE_OUR_USERS" ]; then
951 verbose cp "$d0/misc/buildfiles/win32/libd0_blind_id"-* .libs/
952 verbose cp "$d0/misc/buildfiles/win32/libd0_rijndael"-* .libs/
953 verbose cp "$d0/misc/buildfiles/win32/libgmp"-* .libs/
959 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_blind_id".* .libs/
960 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_rijndael".* .libs/
961 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libgmp".* .libs/
962 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/"
965 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_blind_id".* .libs/
966 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_rijndael".* .libs/
967 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libgmp".* .libs/
968 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/"
976 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_blind_id".* .libs/
977 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_rijndael".* .libs/
987 if [ -f Makefile ]; then
988 verbose make $MAKEFLAGS distclean
991 if ! [ -f Makefile ]; then
992 verbose sh autogen.sh
995 verbose make $MAKEFLAGS
998 verbose cd "$d0/fteqcc"
1000 verbose make $MAKEFLAGS clean
1002 verbose make $MAKEFLAGS
1004 verbose cd "$d0/data/xonotic-data.pk3dir"
1006 verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
1008 verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
1009 # 4 levels up: data, xonotic-data, qcsrc, server
1011 verbose cd "$d0/darkplaces"
1012 if [ x"$BAD_TARGETS" = x" " ]; then
1013 $ECHO "Warning: invalid empty client, default clients will be used."
1016 verbose make $MAKEFLAGS clean
1018 for T in $TARGETS; do
1019 verbose make $MAKEFLAGS STRIP=: "$@" "$T"
1021 for T in $BAD_TARGETS; do
1022 $ECHO "Warning: discarded invalid client $T."
1025 verbose "$SELF" update-maps
1028 if [ -n "$WE_HATE_OUR_USERS" ]; then
1030 export PATH="$d0/misc/buildfiles/win32:$d0/d0_blind_id/.libs:$PATH"
1031 elif [ x"`uname`" = x"Darwin" ]; then
1032 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/MacOS:$d0/d0_blind_id/.libs"
1033 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
1036 export LD_LIBRARY_PATH="$d0/d0_blind_id/.libs"
1040 sdl|glx|agl|dedicated)
1049 if ! [ -x "darkplaces/darkplaces$client" ]; then
1050 if [ -x "darkplaces/darkplaces$client.exe" ]; then
1053 $ECHO "Client darkplaces/darkplaces$client not found, aborting"
1057 set -- "darkplaces/darkplaces$client" -xonotic -mygames "$@"
1059 # if pulseaudio is running: USE IT
1060 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
1061 if ps -C pulseaudio >/dev/null; then
1062 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
1063 export SDL_AUDIODRIVER=pulse
1070 if [ x"$USE_GDB" = x"yes" ]; then
1071 set -- gdb --args "$@"
1072 elif [ x"$USE_GDB" != x"no" ] && which gdb >/dev/null 2>&1; then
1073 set -- gdb --batch -x savecore.gdb --args "$@"
1074 elif which catchsegv >/dev/null 2>&1; then
1075 set -- catchsegv "$@"
1079 if [ -f xonotic.core ]; then
1080 if yesno "The program has CRASHED. Do you want to examine the core dump?"; then
1081 gdb "$binary" xonotic.core
1082 #elif yesno "You did not want to examine the core dump. Do you want to provide it - including your DarkPlaces checkout - to the Xonotic developers?"; then
1083 # tar cvzf xonotic.core.tar.gz xonotic.core darkplaces/*.c darkplaces/*.h
1085 # rm -f xonotic.core.tar.gz
1087 $ECHO "The core dump can be examined later by"
1088 $ECHO " gdb $binary xonotic.core"
1095 if [ x"$1" = x"-k" ]; then
1100 if verbose cd "$d0/$d"; then
1101 if $keep_going; then
1102 verbose "$@" || true
1112 patchdir=`mktemp -d -t save-patches.XXXXXX`
1114 enter "$d0/$d" verbose
1115 git branch -v -v | cut -c 3- | {
1117 while read -r BRANCH REV UPSTREAM TEXT; do
1120 UPSTREAM=${UPSTREAM#\[}
1121 UPSTREAM=${UPSTREAM%\]}
1122 UPSTREAM=${UPSTREAM%:*}
1126 UPSTREAM=origin/"`repobranch "$d"`"
1130 if [ x"$REV" = x"->" ]; then
1133 if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
1134 $ECHO "$d" > "$patchdir/$i/info.txt"
1135 $ECHO "$BRANCH" >> "$patchdir/$i/info.txt"
1136 $ECHO "$UPSTREAM" >> "$patchdir/$i/info.txt"
1137 $ECHO "$TRACK" >> "$patchdir/$i/info.txt"
1140 rm -rf "$patchdir/$i"
1145 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
1150 patchdir=`mktemp -d -t restore-patches.XXXXXX`
1151 ( cd "$patchdir" && tar xvzf - ) < "$infile"
1153 for P in "$patchdir"/*/info.txt; do
1158 read -r UPSTREAM <&3
1160 verbose git checkout HEAD^0
1161 verbose git branch -D "$BRANCH"
1162 if [ x"$TRACK" = x"true" ]; then
1163 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
1165 verbose git branch -b "$BRANCH" "$UPSTREAM"
1184 report=$report"$*$LF"
1189 report=$report" $*$LF"
1194 o=`"$@" | sed 's/^/ /' || true`
1200 # sorry, fteqcc repo is managed manually
1204 enter "$d0/$d" verbose
1205 base="`repobranch "$d"`"
1207 for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
1208 case "${ref#refs/remotes/origin/}" in
1221 if [ -n "$branch" ]; then
1222 if [ x"$branch" != x"${ref#refs/remotes/origin/}" ]; then
1231 l0=`git rev-list "$base".."$ref" | wc -l`
1232 l1=`git rev-list master.."$ref" | wc -l`
1233 if [ $l0 -gt $l1 ]; then
1240 reportecho " Branch $ref:"
1241 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1242 logdata=`git log --color "$realbase".."$ref"`
1243 if [ -z "$logdata" ]; then
1244 reportecho4 "--> not merging, no changes vs master"
1245 if yesno "Branch \"$ref\" probably should get deleted. Do it?" ''; then
1246 git push origin :"${ref#refs/remotes/origin/}"
1247 reportecho4 "--> branch deleted"
1250 diffdata=`git diff --color --find-copies-harder --ignore-space-change "$realbase"..."$ref"`
1251 if [ -z "$diffdata" ]; then
1252 reportecho4 "--> not merging, no changes vs master, branch contains redundant history"
1253 if yesno "Branch \"$ref\" probably should get deleted. Do it?" '{ $ECHO "$logdata"; } | less -r'; then
1254 git push origin :"${ref#refs/remotes/origin/}"
1255 reportecho4 "--> branch deleted"
1257 elif $only_delete; then
1258 reportecho4 "--> skipped in delete-only run"
1259 elif [ -z "$branch" ] && [ -n "$note" ]; then
1260 reportdo4 $ECHO "$note"
1261 reportecho4 "--> not merging, already had this one rejected before"
1262 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ $ECHO "$logdata"; $ECHO "$diffdata"; } | less -r'; then
1263 git checkout "$realbase"
1264 org=`git rev-parse HEAD`
1265 if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
1266 git reset --hard "$org"
1267 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
1269 reportecho4 "--> merge failed"
1270 elif ! "$SELF" compile 2>&1 | tee "$t"; then
1271 git reset --hard "$org"
1272 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
1274 reportecho4 "--> compile failed"
1275 elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
1276 git reset --hard "$org"
1277 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
1278 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1279 if [ x"$note" = x"del" ]; then
1280 git push origin :"${ref#refs/remotes/origin/}"
1281 reportecho4 "--> test failed, branch deleted"
1282 elif [ -n "$note" ]; then
1283 reportdo4 $ECHO "$note"
1284 reportecho4 "--> test failed"
1286 reportecho4 "--> test failed, postponed"
1289 # apply crlf, or other cleanup filters (non-behavioural changes)
1291 find . -type f -exec touch {} \;
1292 git commit -a --amend -C HEAD || true # don't fail if nothing to commit
1295 case ",`repoflags "$d"`," in
1297 # we do quite a mess here... luckily we know $org
1298 git fetch # svn needs to be current
1299 git rebase -i --onto origin/master "$org"
1300 git svn dcommit --add-author-from
1301 git reset --hard "$org"
1304 git push origin HEAD
1307 reportecho4 "--> MERGED"
1308 if yesno "Delete original branch \"$ref\"?"; then
1309 git push origin :"${ref#refs/remotes/origin/}"
1310 reportecho4 "--> branch deleted"
1314 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
1315 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1316 if [ x"$note" = x"del" ]; then
1317 git push origin :"${ref#refs/remotes/origin/}"
1318 reportecho4 "--> branch deleted"
1319 elif [ -n "$note" ]; then
1320 reportdo4 $ECHO "$note"
1321 reportecho4 "--> rejected"
1323 reportecho4 "--> postponed"
1332 $ECHO "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
1344 # ./all clean [-m] [-f | -fu | -fU] [-r] [-D]
1345 # ./all clean --reclone
1348 if [ x"$X" = x"--reclone" ]; then
1355 elif [ x"$X" = x"-f" ]; then
1357 elif [ x"$X" = x"-u" ]; then
1359 elif [ x"$X" = x"-U" ]; then
1362 elif [ x"$X" = x"-fu" ]; then
1365 elif [ x"$X" = x"-fU" ]; then
1369 elif [ x"$X" = x"-m" ]; then
1371 elif [ x"$X" = x"-r" ]; then
1373 elif [ x"$X" = x"-D" ]; then
1375 elif $ECHO "$X" | grep '^-FFFF*UUUU*$' >/dev/null; then
1378 msg " ,--'-\\P/\`\\ FFFFFFF"
1379 msg " __/_ B/,-.\\ FFFFFFF"
1380 msg " / _\\ (// O\\\\ FFFFFF"
1381 msg "| (O \`) _\\._ _)\\ FFFUU"
1382 msg "| |___/.^d0~~\"\\ \\ UUUU"
1383 msg "| |\`~' \\ | UUUU"
1384 msg "| | __,C>|| UUUU"
1385 msg "\\ /_ ,-/,-' | UUUU"
1386 msg " \\\\_ \\_>~' / UUUU-"
1389 msg "Unknown arg: $X"
1398 if $gotoupstream; then
1400 msg "Must also use -f (delete local changes) when using -u"
1403 if $gotomaster; then
1404 if $fetchupstream; then
1405 verbose git fetch origin
1406 verbose git remote prune origin
1408 verbose git checkout -f "`repobranch "$d"`"
1409 verbose git reset --hard origin/"`repobranch "$d"`"
1411 r=`git symbolic-ref HEAD`
1413 rem=`git config "branch.$r.remote" || $ECHO origin`
1414 bra=`git config "branch.$r.merge" || $ECHO "$r"`
1415 upstream="$rem/${bra#refs/heads/}"
1416 if $fetchupstream; then
1417 verbose git fetch "$rem"
1418 verbose git remote prune "$rem"
1420 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
1421 upstream="origin/`repobranch "$d"`"
1423 verbose git reset --hard "$upstream"
1425 elif $gotomaster; then
1427 verbose git checkout -f "`repobranch "$d"`"
1428 verbose git reset --hard
1430 verbose git checkout "`repobranch "$d"`"
1433 verbose git reset --hard
1435 if $rmuntracked; then
1438 verbose git clean -df || true
1441 verbose git clean -xdf || true
1445 if $killbranches; then
1446 git for-each-ref --format='%(refname)' refs/heads/ | while IFS= read -r B; do
1447 if [ x"$B" != x"`git symbolic-ref HEAD`" ]; then
1448 verbose git branch -D "${B#refs/heads/}"
1451 git rev-parse refs/heads/master >/dev/null 2>&1 || verbose git branch --track master origin/master || true
1452 git rev-parse "refs/heads/`repobranch "$d"`" >/dev/null 2>&1 || verbose git branch --track "`repobranch "$d"`" origin/"`repobranch "$d"`" || true
1454 checkself "$cmd" "$@"
1458 # release building goes here
1460 #"$SELF" each git clean -fxd
1461 case "$RELEASETYPE" in
1463 $ECHO >&2 -n "$ESC[2J$ESC[H"
1470 msg " +---------------------------------------------------------.---+"
1472 msg " +---------------------------------------------------------^---+"
1474 msg " | / \ This is the official release build system. |"
1475 msg " | | | If you are not a member of the Xonotic Core Team, |"
1476 msg " | | STOP | you are not supposed to use this script and should |"
1477 msg " | | | instead use ./all compile to compile the engine |"
1478 msg " | \____/ and game code. |"
1480 msg " | [ I understand ] |"
1481 msg " +-------------------------------------------------------------+"
1483 # A LOT of build infrastructure is required:
1486 # - .ssh/config must be configured so the following
1487 # host names are reachable and have a compile
1488 # infrastructure set up:
1489 # - xonotic-build-linux32 (with gcc on x86)
1490 # - xonotic-build-linux64 (with gcc on x86_64)
1491 # - xonotic-build-win32 (with i586-mingw32msvc-g++)
1492 # - xonotic-build-win64 (with amd64-mingw32msvc-g++
1493 # and x86_64-w64-mingw32-g++)
1494 # - xonotic-build-osx (with Xcode and SDL.framework)
1495 # - AMD Compressonator installed in WINE
1496 # - ResEdit installed in WINE
1497 # - a lot of other requirements you will figure out
1498 # while reading the error messages
1499 # - environment variable RELEASETYPE set
1500 # - optionally, environment variable RELEASEDATE set
1505 msg "Building a FINISHED RELEASE"
1508 msg "Building a $RELEASETYPE"
1511 verbose rm -rf Xonotic Xonotic*.zip
1512 verbose mkdir -p Xonotic
1513 if [ -n "$RELEASEDATE" ]; then
1514 verbose $ECHO "$RELEASEDATE" > Xonotic/stamp.txt
1516 verbose date +%Y%m%d > Xonotic/stamp.txt
1518 verbose git archive --format=tar HEAD -- Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh misc/buildfiles key_0.d0pk | {
1520 verbose mkdir data fteqcc source source/darkplaces source/fteqcc source/d0_blind_id mapping
1522 verbose rm -rf misc/builddeps
1523 verbose mv misc/buildfiles/win32/* . || true
1524 verbose mv misc/buildfiles/win64 bin64 || true
1525 verbose mv misc/buildfiles/osx/* . || true
1526 verbose rm -rf misc/buildfiles
1527 verbose rm -rf misc/pki
1530 verbose cd darkplaces
1531 verbose git archive --format=tar HEAD
1533 verbose cd Xonotic/source/darkplaces
1538 verbose git archive --format=tar HEAD
1540 verbose cd Xonotic/source/fteqcc
1544 verbose cd data/xonotic-data.pk3dir
1545 verbose git archive --format=tar HEAD -- qcsrc Makefile
1547 verbose cd Xonotic/source
1551 verbose cd d0_blind_id
1552 verbose git archive --format=tar HEAD
1554 verbose cd Xonotic/source/d0_blind_id
1556 verbose sh autogen.sh
1558 rm -f Xonotic/key_15.d0pk
1560 verbose cd Xonotic/mapping
1561 verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20110223.tar.bz2
1562 verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20110223-win32-7z.exe
1563 for X in *-7z.exe; do
1567 # TODO possibly include other tools?
1570 release-compile-run)
1579 if [ -n "$targetfiles" ]; then
1580 case " $HOSTS_THAT_ARE_DISABLED " in
1585 case " $HOSTS_THAT_ARE_MYSELF " in
1587 verbose rsync --delete -zLvaSHP "$srcdir"/ "$buildpath/"
1588 verbose rsync --delete -zLvaSHP "$depsdir"/ "$buildpath.deps/"
1589 verbose ln -snf "$buildpath.deps" "$buildpath/.deps"
1590 verbose eval make -C "$buildpath" clean $maketargets $makeflags
1591 for f in $targetfiles; do
1592 verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
1596 verbose rsync --delete -zLvaSHP "$srcdir"/ "$host:$buildpath/"
1597 verbose rsync --delete -zLvaSHP "$depsdir"/ "$host:$buildpath.deps/"
1598 verbose ssh "$host" "ln -snf $buildpath.deps $buildpath/.deps && cd $buildpath && nice -`nice` make clean $maketargets $makeflags"
1599 for f in $targetfiles; do
1600 verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
1604 # now rebrand the binaries...
1605 for f in $targetfiles; do
1606 #verbose "$d0/misc/tools/rebrand-darkplaces-engine.sh" "${XONOTIC_BRAND:-$d0/misc/tools/xonotic.brand}" "${f##*:}" || true
1608 Xonotic/xonotic*.exe)
1609 verbose "$d0/misc/tools/change-icon-of-exe.sh" "$d0/misc/logos/icons_ico/xonotic.ico" "${f##*:}"
1611 d=`mktemp -d -t rebrand.XXXXXX`
1613 $ECHO "-mygames" > darkplaces.opt
1614 zip -9r darkplaces.zip darkplaces.opt
1627 fteqcc_maketargets=$3
1629 darkplaces_maketargets=$5
1631 host=xonotic-build-$suffix
1632 verbose "$SELF" release-compile-run "$host" /tmp/fteqcc.build."$suffix" "$fteqcc_maketargets" "$makeflags" "Xonotic/source/fteqcc" "$d0/misc/builddeps/dp.$suffix" "$fteqcc_files"
1633 verbose "$SELF" release-compile-run "$host" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$d0/misc/builddeps/dp.$suffix" "$darkplaces_files"
1635 release-engine-win32)
1636 verbose "$SELF" release-compile win32 \
1637 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -march=i686 -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib -DUSE_WSPIAPI_H -DSUPPORTIPV6" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN32RELEASE=1 D3D=0' \
1638 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc.exe' \
1640 verbose "$SELF" release-compile win32 \
1641 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-g++ -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib -DUSE_WSPIAPI_H -DSUPPORTIPV6" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN32RELEASE=1 D3D=1' \
1643 release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
1645 release-engine-win64)
1646 verbose "$SELF" release-compile win64 \
1647 'STRIP=: DP_MAKE_TARGET=mingw CC="amd64-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib -DSUPPORTIPV6" WINDRES="amd64-mingw32msvc-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN64RELEASE=1 D3D=0' \
1648 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc-x64.exe' \
1649 'sv-release sdl-release' 'darkplaces-sdl.exe:Xonotic/xonotic-x64-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-x64-dedicated.exe'
1650 verbose "$SELF" release-compile win64 \
1651 'STRIP=: DP_MAKE_TARGET=mingw CC="x86_64-w64-mingw32-g++ -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib -DSUPPORTIPV6" WINDRES="x86_64-w64-mingw32-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN64RELEASE=1 D3D=1' \
1653 cl-release 'darkplaces.exe:Xonotic/xonotic-x64.exe'
1656 # gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
1657 verbose "$SELF" release-compile osx \
1658 'STRIP=: CC="gcc -g -arch i386 -arch ppc -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 -I.deps/include -L.deps/lib -fno-reorder-blocks -DSUPPORTIPV6"' \
1659 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.osx' \
1660 'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic-SDL.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
1661 verbose "$SELF" release-compile osx \
1662 'STRIP=: CC="gcc -g -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.4 -I.deps/include -L.deps/lib -fno-reorder-blocks -DSUPPORTIPV6"' \
1664 'cl-release' 'darkplaces-agl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-agl-bin'
1666 release-engine-linux32)
1667 verbose "$SELF" release-compile linux32 \
1668 'STRIP=: CC="gcc -m32 -march=i686 -g -I.deps/include -L.deps/lib -DSUPPORTIPV6" DP_MODPLUG_STATIC_LIBDIR=.deps/lib LIB_JPEG=.deps/lib/libjpeg.a DP_CRYPTO_STATIC_LIBDIR=.deps/lib' \
1669 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux32' \
1670 release 'darkplaces-glx:Xonotic/xonotic-linux32-glx darkplaces-sdl:Xonotic/xonotic-linux32-sdl darkplaces-dedicated:Xonotic/xonotic-linux32-dedicated'
1672 release-engine-linux64)
1673 verbose "$SELF" release-compile linux64 \
1674 'STRIP=: CC="gcc -m64 -g -I.deps/include -L.deps/lib -DSUPPORTIPV6" DP_MODPLUG_STATIC_LIBDIR=.deps/lib LIB_JPEG=.deps/lib/libjpeg.a DP_CRYPTO_STATIC_LIBDIR=.deps/lib' \
1675 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux64' \
1676 release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
1679 verbose "$SELF" release-engine-linux32 &
1680 verbose "$SELF" release-engine-linux64 &
1681 verbose "$SELF" release-engine-win32 &
1682 verbose "$SELF" release-engine-win64 &
1683 verbose "$SELF" release-engine-osx &
1692 verbose "$SELF" update-maps
1695 verbose make -C Xonotic/source FTEQCC="../../../fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all
1696 verbose rm -f Xonotic/source/qcsrc/*/fteqcc.log
1698 release-buildpk3-transform-raw)
1701 release-buildpk3-transform-normal)
1704 # texture: convert to jpeg and dds
1705 verbose export do_jpeg=true
1706 verbose export jpeg_qual_rgb=97
1707 verbose export jpeg_qual_a=99
1708 verbose export do_dds=false
1709 verbose export do_ogg=false
1710 verbose export del_src=true
1711 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1713 release-buildpk3-transform-normaldds)
1716 # texture: convert to jpeg and dds
1717 # music: reduce bitrate
1718 verbose export do_jpeg=false
1719 verbose export do_jpeg_if_not_dds=true
1720 verbose export jpeg_qual_rgb=95
1721 verbose export jpeg_qual_a=99
1722 verbose export do_dds=true
1723 verbose export dds_flags=
1724 verbose export do_ogg=true
1725 verbose export del_src=true
1726 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1728 release-buildpk3-transform-low)
1731 # texture: convert to jpeg and dds
1732 # music: reduce bitrate
1733 verbose export do_jpeg=true
1734 verbose export jpeg_qual_rgb=80
1735 verbose export jpeg_qual_a=97
1736 verbose export do_dds=false
1737 verbose export do_ogg=true
1738 verbose export ogg_qual=1
1739 verbose export del_src=true
1740 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1742 release-buildpk3-transform-lowdds)
1745 # texture: convert to jpeg and dds
1746 # music: reduce bitrate
1747 verbose export do_jpeg=false
1748 verbose export do_jpeg_if_not_dds=true
1749 verbose export jpeg_qual_rgb=80
1750 verbose export jpeg_qual_a=99
1751 verbose export do_dds=true
1752 verbose export dds_flags=
1753 verbose export do_ogg=true
1754 verbose export ogg_qual=1
1755 verbose export del_src=true
1756 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1769 verbose rm -rf Xonotic/temp
1770 verbose mkdir -p Xonotic/temp
1773 verbose git archive --format=tar HEAD
1775 verbose cd Xonotic/temp
1778 verbose cd Xonotic/temp
1779 if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
1780 verbose cp ../source/progs.dat .
1781 verbose cp ../source/csprogs.dat .
1782 verbose cp ../source/menu.dat .
1783 verbose rm -rf qcsrc
1784 gv=`grep "^gameversion " "defaultXonotic.cfg" | awk '{ print $2 }'`
1785 major=$(($gv / 10000))
1786 minor=$((($gv / 100) - ($major * 100)))
1787 patch=$(($gv - ($major * 10000) - ($minor * 100)))
1788 versionstr="$major.$minor.$patch"
1789 case "$RELEASETYPE" in
1793 versionstr="$versionstr$RELEASETYPE"
1797 s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
1798 s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
1799 s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
1800 " defaultXonotic.cfg
1801 case "$RELEASETYPE" in
1803 echo "" >> defaultXonotic.cfg
1804 echo "// nicer menu" >> defaultXonotic.cfg
1805 echo "set menu_watermark \"\"" >> defaultXonotic.cfg
1809 verbose cd gfx/menu/luminos
1810 verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg .
1811 verbose "$d0"/mediasource/gfx/menu/luminos_versionbuilder/versionbuilder "$versionstr"
1812 verbose rm background_l2.svg
1815 if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
1816 for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
1817 if [ -f "$X" ]; then
1819 verbose rm -f maps/*.log maps/*.irc maps/*.lin
1823 verbose export git_src_repo="$d0/$src" # skip hash-object
1824 verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
1825 verbose mkzip "../../$dst" *
1827 verbose rm -rf Xonotic/temp
1830 stamp=`cat Xonotic/stamp.txt`
1836 dst="data/xonotic-$stamp-${dst#data/xonotic-}"
1842 while [ "$#" -gt 1 ]; do
1843 verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
1849 verbose "$SELF" release-buildpk3s data/font-nimbussansl.pk3dir raw ''
1850 verbose "$SELF" release-buildpk3s data/font-xolonium.pk3dir raw ''
1851 verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir normal '-high' low '-low' normaldds ''
1852 verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir normal '-high' low '-low' normaldds ''
1853 verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
1854 verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir normal '-high' normaldds ''
1856 release-pack-needsx11)
1859 verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
1862 verbose "$SELF" release-pack
1867 stamp=`cat Xonotic/stamp.txt`
1868 # exe and dll files do not need +x, so this makes them eligible for 7zip compression too
1869 chmod a-x Xonotic/*.exe Xonotic/*.dll || true
1870 # let's pass crypto import laws of some nasty countries
1871 crypto_libs=`find Xonotic -name \*d0_rijndael\*.so -o -name \*d0_rijndael\*.dylib -o -name \*d0_rijndael\*.dll -o -name \*d0_rijndael\*.c`
1872 if [ -n "$crypto_libs" ]; then
1873 verbose mkzip Xonotic-$stamp-crypto.zip \
1877 # build the archives
1878 verbose mkzip Xonotic-$stamp-engine.zip \
1880 Xonotic/bin64/*.dll \
1883 Xonotic/xonotic.exe \
1884 Xonotic/source/darkplaces/
1885 verbose cp Xonotic-$stamp-engine.zip Xonotic-$stamp-common.zip
1886 verbose mkzip Xonotic-$stamp-common.zip \
1887 Xonotic/source/fteqcc/ \
1888 Xonotic/source/qcsrc/ \
1893 Xonotic/key_0.d0pk \
1894 Xonotic/data/font-nimbussansl-$stamp.pk3 \
1895 Xonotic/data/font-xolonium-$stamp.pk3
1896 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
1897 verbose mkzip0 Xonotic-$stamp.zip \
1898 Xonotic/data/xonotic-$stamp-data.pk3 \
1899 Xonotic/data/xonotic-$stamp-maps.pk3 \
1900 Xonotic/data/xonotic-$stamp-music.pk3 \
1901 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1902 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-low.zip
1903 verbose mkzip0 Xonotic-$stamp-low.zip \
1904 Xonotic/data/xonotic-$stamp-data-low.pk3 \
1905 Xonotic/data/xonotic-$stamp-maps-low.pk3 \
1906 Xonotic/data/xonotic-$stamp-music-low.pk3
1907 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
1908 verbose mkzip0 Xonotic-$stamp-high.zip \
1909 Xonotic/data/xonotic-$stamp-data-high.pk3 \
1910 Xonotic/data/xonotic-$stamp-maps-high.pk3 \
1911 Xonotic/data/xonotic-$stamp-music.pk3 \
1912 Xonotic/data/xonotic-$stamp-nexcompat-high.pk3
1913 verbose mkzip Xonotic-$stamp-mappingsupport.zip \
1915 verbose mkzip0 Xonotic-$stamp-mappingsupport.zip \
1916 Xonotic/data/xonotic-$stamp-maps-low.pk3 # TODO add a Radiant build
1919 verbose "$SELF" release-prepare
1920 verbose "$SELF" release-maps
1921 verbose "$SELF" release-engine
1922 verbose "$SELF" release-qc
1923 verbose "$SELF" release-pack-needsx11
1924 verbose "$SELF" release-zip
1929 $ECHO " $SELF admin-merge [<branch>]"
1930 $ECHO " $SELF branch <branch>"
1931 $ECHO " $SELF branch <remote> <branch> [<srcbranch>]"
1932 $ECHO " $SELF branches"
1933 $ECHO " $SELF checkout|switch <branch>"
1934 $ECHO " $SELF checkout|switch <remote>/<branch>"
1935 $ECHO " $SELF clean [-m] [-f | -fu | -fU] [-r] [-D]"
1936 $ECHO " $SELF clean --reclone"
1937 $ECHO " $SELF compile [-c] [-r] [-0]"
1938 $ECHO " $SELF each|foreach [-k] command..."
1939 $ECHO " $SELF fix_upstream_rebase"
1940 $ECHO " $SELF keygen"
1941 $ECHO " $SELF merge"
1942 $ECHO " $SELF push|commit [-s]"
1943 $ECHO " $SELF release"
1944 $ECHO " $SELF restore-patches"
1945 $ECHO " $SELF run [sdl|glx|wgl|agl|dedicated] options..."
1946 $ECHO " $SELF save-patches"
1947 $ECHO " $SELF update-maps"
1948 $ECHO " $SELF update|pull [-N] [-s | -h [-p] | -g [-p]] [-l de|nl|default]"