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
276 fix_upstream_rebase()
278 if [ -z "$r_me" ] || [ -z "$r_other" ]; then
282 # one of the two sides of the merge should be remote upstream, or all is fine
283 r_r=`git symbolic-ref HEAD`
284 r_r=${r_r#refs/heads/}
285 r_rem=`git config "branch.$r_rem.remote" || $ECHO origin`
286 r_bra=`git config "branch.$r_bra.merge" || $ECHO "$r_r"`
287 r_bra=${r_bra#refs/heads/}
288 if [ x"$r_me" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then
289 if [ x"$r_other" != x"`git rev-parse "$r_rem/$r_bra"`" ]; then
294 r_base=`git merge-base "$r_me" "$r_other"`
296 # no merge-base? upstream did filter-branch
297 if [ -n "$r_base" ]; then
298 # otherwise, check if the two histories are "similar"
299 r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
300 r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
302 # heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
303 r_lc_me=`$ECHO "$r_l_me" | wc -l`
304 r_lc_other=`$ECHO "$r_l_other" | wc -l`
305 r_lc_together=`{ $ECHO "$r_l_me"; $ECHO "$r_l_other"; } | sort -u | wc -l`
306 r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
308 if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
309 if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
310 git reset --hard "$r_me"
320 fix_upstream_rebase_mergeok()
322 r_me=`git rev-parse --revs-only HEAD^1 2>/dev/null || true`
323 r_other=`git rev-parse --revs-only HEAD^2 2>/dev/null || true`
327 fix_upstream_rebase_mergefail()
329 r_me=`git rev-parse --revs-only HEAD 2>/dev/null || true`
330 r_other=`git rev-parse --revs-only MERGE_HEAD 2>/dev/null || true`
336 verbose git config remote.origin.url "$1"
338 verbose git config remote.origin.pushurl "$2"
340 verbose git config --unset remote.origin.pushurl || true
342 verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
343 case ",`repoflags "$d"`," in
345 verbose git config --unset core.autocrlf || true
348 verbose git config core.autocrlf input
351 if [ -z "`git config push.default || true`" ]; then
352 verbose git config push.default current # or is tracking better?
354 verbose git config filter.mapclean.clean "tr -d '\r' | grep '^[^/]'"
355 verbose git config filter.mapclean.smudge "cat"
361 find "$@" -exec touch -d "2001-01-01 01:01:01 +0000" {} \+ # ugly hack to make the pk3 files rsync-friendly
363 find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
364 7za a -tzip -mx=9 -x@"$ziplist" "$archive" "$@" || true
365 zip -9y -@<"$ziplist" "$archive" || true
373 find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
374 7za a -tzip -mx=9 -x@"$ziplist" "$archive" "$@" || true
375 zip -9y -@<"$ziplist" "$archive" || true
382 zip -0ry "$archive" "$@"
387 # first result is to be ignored, but we use it to check status
388 git ls-remote "$1" refs/heads/master >/dev/null 2>&1 || return 1
389 { 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*,,'
390 # unit: clock ticks (depends on what "time" returns
398 if ! { time -p true; } >/dev/null 2>&1; then
399 msg "Cannot do timing in this shell"
417 if t=`mirrorspeed "$m"`; then
419 tt=$(($t$op)) # fudge factor
420 msg "$m -> $t$op = $tt ticks"
421 if [ -z "$bestt" ] || [ "$tt" -lt "$bestt" ]; then
432 if [ -n "$bestin" ]; then
433 msg "Best mirror seems to be $pre$bestin$suf"
443 enter "$d0/$d" verbose
444 verbose fix_upstream_rebase_mergefail && verbose fix_upstream_rebase_mergeok
450 pushurl=`repopushurl "$d"`
451 branch=`repobranch "$d"`
452 if [ -d "$d0/$d" ]; then
454 fix_git_config "$url" "$pushurl"
460 # enable the ssh URL for pushing
463 if [ -f ~/.ssh/id_rsa.pub ]; then
465 msg "A key already exists and no new one will be generated. If you"
466 msg "already have done the procedure for getting your key approved, you"
467 msg "can skip the following paragraph and already use the repository."
469 msg "To get access, your key has to be approved first. For that, visit"
470 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
471 msg "the \"Support\" tracker in the \"Repository\" category where you"
472 msg "apply for access and paste the following output into the issue:"
474 msg "`cat ~/.ssh/id_rsa.pub`"
476 msg "Note that you will only have write access to branches that start"
477 msg "with your user name."
478 elif [ -f ~/.ssh/id_dsa.pub ]; then
480 msg "A key already exists and no new one will be generated. If you"
481 msg "already have done the procedure for getting your key approved, you"
482 msg "can skip the following paragraph and already use the repository."
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_dsa.pub`"
491 msg "Note that you will only have write access to branches that start"
492 msg "with your user name."
495 msg "No key has been generated yet. One will be generated now."
496 msg "If other people are using your computer, it is recommended"
497 msg "to specify a passphrase. Otherwise you can simply hit ENTER"
498 msg "when asked for a passphrase."
500 ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa
502 msg "To get access, your key has to be approved first. For that, visit"
503 msg "http://dev.xonotic.org/, then log in, create a \"New Issue\" on"
504 msg "the \"Support\" tracker in the \"Repository\" category where you"
505 msg "apply for access and paste the following output into the issue:"
507 msg "`cat ~/.ssh/id_rsa.pub`"
509 msg "Note that you will only have write access to branches that start"
510 msg "with your user name."
518 if [ x"$1" = x"-N" ]; then
520 elif [ x"$1" = x"-p" ]; then
522 pushbase=ssh://xonotic@git.xonotic.org/
523 elif [ x"$1" = x"-ps" ]; then
525 pushbase=ssh://xonotic@git.xonotic.org/
526 elif [ x"$1" = x"-ph" ]; then
528 pushbase=http://git.xonotic.org/login/xonotic/
529 elif [ x"$1" = x"-s" ]; then
531 base=ssh://xonotic@git.xonotic.org/
532 elif [ x"$1" = x"-g" ]; then
534 base=git://git.xonotic.org/xonotic/
535 elif [ x"$1" = x"-h" ]; then
537 base=http://git.xonotic.org/xonotic/
538 elif [ x"$1" = x"-l" ]; then
546 msg "Invalid location!"
547 msg "Possible locations for the -l option:"
548 msg " nl (Netherlands, run by merlijn)"
549 msg " de (Germany, run by divVerent)"
550 msg " us (United States of America, run by detrate)"
551 msg " best (find automatically)"
552 msg " default (currently nl)"
566 if [ x"`git config xonotic.all.mirrorselection 2>/dev/null || true`" != x"done" ]; then
573 # if we fetched via ssh://, switch to git:// for fetching and keep using ssh:// for pushing
577 base=git://git.xonotic.org/xonotic/
580 newbase=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,:// .git.xonotic.org/,"`
583 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 config xonotic.all.mirrorselection done
601 *://*.git.xonotic.org/*)
602 location=${base%%.git.xonotic.org/*}
603 location=${location##*://}
611 if [ -n "$location" ]; then
612 base=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,://$location.git.xonotic.org/,"`
613 pushbase=`$ECHO "$pushbase" | sed "s,://\(.*\.\)\?git.xonotic.org/,://$location.git.xonotic.org/,"`
615 base=`$ECHO "$base" | sed "s,://\(.*\.\)\?git.xonotic.org/,://git.xonotic.org/,"`
616 pushbase=`$ECHO "$pushbase" | sed "s,://\(.*\.\)\?git.xonotic.org/,://git.xonotic.org/,"`
620 pushurl=`repopushurl .`
621 fix_git_config "$url" "$pushurl"
623 if $allow_pull || $fix_config; then
628 pushurl=`repopushurl "$d"`
629 branch=`repobranch "$d"`
630 if [ -d "$d0/$d" ]; then
631 # if we have .no file, skip
632 if [ -f "$d0/$d.no" ]; then
633 msg "Repository $d disabled by a .no file, delete $d.no to enable; thus, not updated"
637 enter "$d0/$d" verbose
638 r=`git symbolic-ref HEAD`
640 if git config branch.$r.remote >/dev/null 2>&1; then
641 if ! verbose git pull; then
642 fix_upstream_rebase_mergefail || true
643 check_mergeconflict "$d"
644 $ECHO "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
647 fix_upstream_rebase_mergeok || true
652 checkself "$cmd" "$@"
654 verbose git remote prune origin
658 verbose git clone "$url" "$d0/$d"
659 enter "$d0/$d" verbose
660 fix_git_config "$url" "$pushurl"
661 if [ "$branch" != "master" ]; then
662 verbose git checkout --track -b "$branch" origin/"$branch"
669 misc/tools/xonotic-map-compiler-autobuild download
673 if [ x"$1" = x"-f" ]; then
679 if [ -z "$branch" ]; then
682 branch=${remote#origin/}
691 if [ -n "$checkoutflags" ]; then
692 set -- -f "$@" # to make checkself work again
696 enter "$d0/$d" verbose
698 if [ -n "$b" ] && git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
700 verbose git checkout $checkoutflags "$b"
701 elif [ -n "$b" ] && git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
703 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
706 if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
708 verbose git checkout $checkoutflags "$b"
709 elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
711 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
713 $ECHO "WTF? Not even branch $b doesn't exist in $d"
718 checkself "$cmd" "$@"
722 $ECHO "The requested branch was not found in any repository."
730 if [ -z "$branch" ]; then
734 if [ -z "$branch" ]; then
737 r=`git symbolic-ref HEAD`
744 dv=`visible_repo_name "$d"`
745 enter "$d0/$d" verbose
746 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
747 $ECHO "Already having this branch in $dv."
749 if yesno "Branch in $dv?"; then
750 if [ -n "$srcbranch" ]; then
753 b=origin/"`repobranch "$d"`"
754 verbose git fetch origin || true
756 # TODO do this without pushing
757 verbose git checkout -b "$branch" "$b"
758 verbose git config "branch.$branch.remote" "$remote"
759 verbose git config "branch.$branch.merge" "refs/heads/$branch"
769 cd "$d0/$d" # am in a pipe, shouldn't use enter
770 git branch -r -v -v | cut -c 3- | sed "s/^(no branch)/(no_branch)/" | sed "s,^,$d ,"
775 while read -r d BRANCH REV TEXT; do
776 if [ x"$BRANCH" = x"`repobranch "$d"`" ]; then
779 if [ x"$REV" = x"->" ]; then
782 BRANCH=${BRANCH#remotes/}
783 ID=`$ECHO "$BRANCH" | tr -c "A-Za-z0-9." "_"`
784 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
785 eval "r=\$branches_repos_$ID"
787 eval "branches_repos_$ID=\$r"
789 $ECHO -n "$branches_list" | xargs -n 1 $ECHO | sort -u | while IFS= read -r BRANCH; do
790 ID=`$ECHO "$BRANCH" | tr -c "A-Za-z0-9." "_"`
791 eval "r=\$branches_repos_$ID"
792 printf "%-60s %s\n" "$BRANCH" "$r"
799 dv=`visible_repo_name "$d"`
800 enter "$d0/$d" verbose
801 r=`git symbolic-ref HEAD`
803 if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
804 # we have uncommitted changes
805 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
806 if ! verbose git merge origin/"`repobranch "$d"`"; then
807 check_mergeconflict "$d"
808 exit 1 # this should ALWAYS be fatal
818 dv=`visible_repo_name "$d"`
819 enter "$d0/$d" verbose
820 r=`git symbolic-ref HEAD`
822 diffdata=`git diff --color HEAD`
823 if [ -n "$diffdata" ]; then
824 # we have uncommitted changes
825 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?" '$ECHO "$diffdata" | less -r'; then
826 verbose git commit -a
829 rem=`git config "branch.$r.remote" || $ECHO origin`
830 bra=`git config "branch.$r.merge" || $ECHO "$r"`
831 upstream="$rem/${bra#refs/heads/}"
832 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
833 upstream="origin/`repobranch "$d"`"
835 logdata=`git log --color "$upstream".."$r"`
836 if [ -n "$logdata" ]; then
837 if yesno "Push \"$r\" in $dv?" '$ECHO "$logdata" | less -r'; then
838 verbose git push "$rem" HEAD
841 if [ x"$submit" = x"-s" ]; then
844 verbose git push "$rem" HEAD:"${bra%%/*}/finished/${bra#*/}"
858 snowleopardhack=false
859 if [ -z "$CC" ]; then
860 export CC="gcc -DSUPPORTIPV6"
885 case "`$CC -dumpversion`" in
886 [5-9]*|[1-9][0-9]*|4.[3-9]*|4.[1-9][0-9]*)
888 # -march=native is broken < 4.3
889 export CC="$CC -mtune=native -march=native"
892 if [ -n "$WE_HATE_OUR_USERS" ]; then
893 export CC="$CC -fno-common"
902 if [ -n "$WE_HATE_OUR_USERS" ]; then
903 TARGETS="sv-$debug cl-$debug"
904 elif [ x"`uname`" = x"Darwin" ]; then
907 TARGETS="sv-$debug cl-$debug sdl-$debug"
910 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
912 TARGETS="sv-$debug sdl-$debug"
915 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"
917 TARGETS="sv-$debug cl-$debug sdl-$debug"
919 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
920 # if we give the command make the arg "", it will surely fail (invalid filename),
921 # so better handle it as an empty client option
924 elif [ -n "$1" ]; then
926 TARGETS_SAVE=$TARGETS
931 TARGETS="$TARGETS sdl-debug"
934 TARGETS="$TARGETS cl-debug"
935 if $snowleopardhack; then
936 export CC="$CC -arch i386"
940 TARGETS="$TARGETS cl-debug"
943 TARGETS="$TARGETS sv-debug"
946 BAD_TARGETS="$BAD_TARGETS $X"
950 if [ -n "$TARGETS" ]; then # at least a valid client
952 else # no valid client, let's assume this option is not meant to be a client then
953 TARGETS=$TARGETS_SAVE
957 if [ -z "$MAKEFLAGS" ]; then
958 if [ -f /proc/cpuinfo ]; then
959 ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
960 if [ $ncpus -gt 1 ]; then
964 if [ -n "$WE_HATE_OUR_USERS" ]; then
965 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw LIB_JPEG= CFLAGS_LIBJPEG="
969 verbose cd "$d0/d0_blind_id"
970 if ! $compiled0; then
971 # compilation of crypto library failed
972 # use binaries then, if we can...
974 if [ -n "$WE_HATE_OUR_USERS" ]; then
975 verbose cp "$d0/misc/buildfiles/win32/libd0_blind_id"-* .libs/
976 verbose cp "$d0/misc/buildfiles/win32/libd0_rijndael"-* .libs/
977 verbose cp "$d0/misc/buildfiles/win32/libgmp"-* .libs/
983 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_blind_id".* .libs/
984 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libd0_rijndael".* .libs/
985 #verbose cp "$d0/misc/builddeps/dp.linux64/lib/libgmp".* .libs/
986 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux64/lib/"
989 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_blind_id".* .libs/
990 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libd0_rijndael".* .libs/
991 #verbose cp "$d0/misc/builddeps/dp.linux32/lib/libgmp".* .libs/
992 MAKEFLAGS="$MAKEFLAGS DP_CRYPTO_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/ DP_CRYPTO_RIJNDAEL_STATIC_LIBDIR=../misc/builddeps/dp.linux32/lib/"
1000 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_blind_id".* .libs/
1001 verbose cp "$d0/misc/buildfiles/osx/Xonotic.app/Contents/MacOS/libd0_rijndael".* .libs/
1011 if [ -f Makefile ]; then
1012 verbose make $MAKEFLAGS distclean
1015 if ! [ -f Makefile ]; then
1016 verbose sh autogen.sh
1019 verbose make $MAKEFLAGS
1022 verbose cd "$d0/fteqcc"
1024 verbose make $MAKEFLAGS clean
1026 verbose make $MAKEFLAGS
1028 verbose cd "$d0/data/xonotic-data.pk3dir"
1030 verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
1032 verbose make FTEQCC="../../../../fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
1033 # 4 levels up: data, xonotic-data, qcsrc, server
1035 verbose cd "$d0/darkplaces"
1036 if [ x"$BAD_TARGETS" = x" " ]; then
1037 $ECHO "Warning: invalid empty client, default clients will be used."
1040 verbose make $MAKEFLAGS clean
1042 for T in $TARGETS; do
1043 verbose make $MAKEFLAGS STRIP=: "$@" "$T"
1045 for T in $BAD_TARGETS; do
1046 $ECHO "Warning: discarded invalid client $T."
1049 verbose "$SELF" update-maps
1052 if [ -n "$WE_HATE_OUR_USERS" ]; then
1054 export PATH="$d0/misc/buildfiles/win32:$d0/d0_blind_id/.libs:$PATH"
1055 elif [ x"`uname`" = x"Darwin" ]; then
1056 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/MacOS:$d0/d0_blind_id/.libs"
1057 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
1060 export LD_LIBRARY_PATH="$d0/d0_blind_id/.libs"
1064 sdl|glx|agl|dedicated)
1073 if ! [ -x "darkplaces/darkplaces$client" ]; then
1074 if [ -x "darkplaces/darkplaces$client.exe" ]; then
1077 $ECHO "Client darkplaces/darkplaces$client not found, aborting"
1081 set -- "darkplaces/darkplaces$client" -xonotic "$@"
1083 # if pulseaudio is running: USE IT
1084 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
1085 if ps -C pulseaudio >/dev/null; then
1086 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
1087 export SDL_AUDIODRIVER=pulse
1094 if [ x"$USE_GDB" = x"yes" ]; then
1095 set -- gdb --args "$@"
1096 elif [ x"$USE_GDB" != x"no" ] && which gdb >/dev/null 2>&1; then
1097 set -- gdb --batch -x savecore.gdb --args "$@"
1098 elif which catchsegv >/dev/null 2>&1; then
1099 set -- catchsegv "$@"
1103 if [ -f xonotic.core ]; then
1104 if yesno "The program has CRASHED. Do you want to examine the core dump?"; then
1105 gdb "$binary" xonotic.core
1106 #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
1107 # tar cvzf xonotic.core.tar.gz xonotic.core darkplaces/*.c darkplaces/*.h
1109 # rm -f xonotic.core.tar.gz
1111 $ECHO "The core dump can be examined later by"
1112 $ECHO " gdb $binary xonotic.core"
1119 if [ x"$1" = x"-k" ]; then
1124 if verbose cd "$d0/$d"; then
1125 if $keep_going; then
1126 verbose "$@" || true
1136 patchdir=`mktemp -d -t save-patches.XXXXXX`
1138 enter "$d0/$d" verbose
1139 git branch -v -v | cut -c 3- | {
1141 while read -r BRANCH REV UPSTREAM TEXT; do
1144 UPSTREAM=${UPSTREAM#\[}
1145 UPSTREAM=${UPSTREAM%\]}
1146 UPSTREAM=${UPSTREAM%:*}
1150 UPSTREAM=origin/"`repobranch "$d"`"
1154 if [ x"$REV" = x"->" ]; then
1157 if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
1158 $ECHO "$d" > "$patchdir/$i/info.txt"
1159 $ECHO "$BRANCH" >> "$patchdir/$i/info.txt"
1160 $ECHO "$UPSTREAM" >> "$patchdir/$i/info.txt"
1161 $ECHO "$TRACK" >> "$patchdir/$i/info.txt"
1164 rm -rf "$patchdir/$i"
1169 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
1174 patchdir=`mktemp -d -t restore-patches.XXXXXX`
1175 ( cd "$patchdir" && tar xvzf - ) < "$infile"
1177 for P in "$patchdir"/*/info.txt; do
1182 read -r UPSTREAM <&3
1184 verbose git checkout HEAD^0
1185 verbose git branch -D "$BRANCH"
1186 if [ x"$TRACK" = x"true" ]; then
1187 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
1189 verbose git branch -b "$BRANCH" "$UPSTREAM"
1208 report=$report"$*$LF"
1213 report=$report" $*$LF"
1218 o=`"$@" | sed 's/^/ /' || true`
1224 # sorry, fteqcc repo is managed manually
1228 enter "$d0/$d" verbose
1229 base="`repobranch "$d"`"
1231 for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
1232 case "${ref#refs/remotes/origin/}" in
1245 if [ -n "$branch" ]; then
1246 if [ x"$branch" != x"${ref#refs/remotes/origin/}" ]; then
1255 l0=`git rev-list "$base".."$ref" | wc -l`
1256 l1=`git rev-list master.."$ref" | wc -l`
1257 if [ $l0 -gt $l1 ]; then
1264 reportecho " Branch $ref:"
1265 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1266 logdata=`git log --color "$realbase".."$ref"`
1267 if [ -z "$logdata" ]; then
1268 reportecho4 "--> not merging, no changes vs master"
1269 if yesno "Branch \"$ref\" probably should get deleted. Do it?" ''; then
1270 git push origin :"${ref#refs/remotes/origin/}"
1271 reportecho4 "--> branch deleted"
1274 diffdata=`git diff --color --find-copies-harder --ignore-space-change "$realbase"..."$ref"`
1275 if [ -z "$diffdata" ]; then
1276 reportecho4 "--> not merging, no changes vs master, branch contains redundant history"
1277 if yesno "Branch \"$ref\" probably should get deleted. Do it?" '{ $ECHO "$logdata"; } | less -r'; then
1278 git push origin :"${ref#refs/remotes/origin/}"
1279 reportecho4 "--> branch deleted"
1281 elif $only_delete; then
1282 reportecho4 "--> skipped in delete-only run"
1283 elif [ -z "$branch" ] && [ -n "$note" ]; then
1284 reportdo4 $ECHO "$note"
1285 reportecho4 "--> not merging, already had this one rejected before"
1286 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ $ECHO "$logdata"; $ECHO "$diffdata"; } | less -r'; then
1287 git checkout "$realbase"
1288 org=`git rev-parse HEAD`
1289 if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
1290 git reset --hard "$org"
1291 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
1293 reportecho4 "--> merge failed"
1294 elif ! "$SELF" compile 2>&1 | tee "$t"; then
1295 git reset --hard "$org"
1296 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
1298 reportecho4 "--> compile failed"
1299 elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
1300 git reset --hard "$org"
1301 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
1302 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1303 if [ x"$note" = x"del" ]; then
1304 git push origin :"${ref#refs/remotes/origin/}"
1305 reportecho4 "--> test failed, branch deleted"
1306 elif [ -n "$note" ]; then
1307 reportdo4 $ECHO "$note"
1308 reportecho4 "--> test failed"
1310 reportecho4 "--> test failed, postponed"
1313 # apply crlf, or other cleanup filters (non-behavioural changes)
1315 find . -type f -exec touch {} \;
1316 git commit -a --amend -C HEAD || true # don't fail if nothing to commit
1319 case ",`repoflags "$d"`," in
1321 # we do quite a mess here... luckily we know $org
1322 git fetch # svn needs to be current
1323 git rebase -i --onto origin/master "$org"
1324 git svn dcommit --add-author-from
1325 git reset --hard "$org"
1328 git push origin HEAD
1331 reportecho4 "--> MERGED"
1332 if yesno "Delete original branch \"$ref\"?"; then
1333 git push origin :"${ref#refs/remotes/origin/}"
1334 reportecho4 "--> branch deleted"
1338 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
1339 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
1340 if [ x"$note" = x"del" ]; then
1341 git push origin :"${ref#refs/remotes/origin/}"
1342 reportecho4 "--> branch deleted"
1343 elif [ -n "$note" ]; then
1344 reportdo4 $ECHO "$note"
1345 reportecho4 "--> rejected"
1347 reportecho4 "--> postponed"
1356 $ECHO "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
1368 # ./all clean [-m] [-f | -fu | -fU] [-r] [-D]
1369 # ./all clean --reclone
1372 if [ x"$X" = x"--reclone" ]; then
1379 elif [ x"$X" = x"-f" ]; then
1381 elif [ x"$X" = x"-u" ]; then
1383 elif [ x"$X" = x"-U" ]; then
1386 elif [ x"$X" = x"-fu" ]; then
1389 elif [ x"$X" = x"-fU" ]; then
1393 elif [ x"$X" = x"-m" ]; then
1395 elif [ x"$X" = x"-r" ]; then
1397 elif [ x"$X" = x"-D" ]; then
1399 elif $ECHO "$X" | grep '^-FFFF*UUUU*$' >/dev/null; then
1402 msg " ,--'-\\P/\`\\ FFFFFFF"
1403 msg " __/_ B/,-.\\ FFFFFFF"
1404 msg " / _\\ (// O\\\\ FFFFFF"
1405 msg "| (O \`) _\\._ _)\\ FFFUU"
1406 msg "| |___/.^d0~~\"\\ \\ UUUU"
1407 msg "| |\`~' \\ | UUUU"
1408 msg "| | __,C>|| UUUU"
1409 msg "\\ /_ ,-/,-' | UUUU"
1410 msg " \\\\_ \\_>~' / UUUU-"
1413 msg "Unknown arg: $X"
1422 if $gotoupstream; then
1424 msg "Must also use -f (delete local changes) when using -u"
1427 if $gotomaster; then
1428 if $fetchupstream; then
1429 verbose git fetch origin
1430 verbose git remote prune origin
1432 verbose git checkout -f "`repobranch "$d"`"
1433 verbose git reset --hard origin/"`repobranch "$d"`"
1435 r=`git symbolic-ref HEAD`
1437 rem=`git config "branch.$r.remote" || $ECHO origin`
1438 bra=`git config "branch.$r.merge" || $ECHO "$r"`
1439 upstream="$rem/${bra#refs/heads/}"
1440 if $fetchupstream; then
1441 verbose git fetch "$rem"
1442 verbose git remote prune "$rem"
1444 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
1445 upstream="origin/`repobranch "$d"`"
1447 verbose git reset --hard "$upstream"
1449 elif $gotomaster; then
1451 verbose git checkout -f "`repobranch "$d"`"
1452 verbose git reset --hard
1454 verbose git checkout "`repobranch "$d"`"
1457 verbose git reset --hard
1459 if $rmuntracked; then
1462 verbose git clean -df || true
1465 verbose git clean -xdf || true
1469 if $killbranches; then
1470 git for-each-ref --format='%(refname)' refs/heads/ | while IFS= read -r B; do
1471 if [ x"$B" != x"`git symbolic-ref HEAD`" ]; then
1472 verbose git branch -D "${B#refs/heads/}"
1475 git rev-parse refs/heads/master >/dev/null 2>&1 || verbose git branch --track master origin/master || true
1476 git rev-parse "refs/heads/`repobranch "$d"`" >/dev/null 2>&1 || verbose git branch --track "`repobranch "$d"`" origin/"`repobranch "$d"`" || true
1478 checkself "$cmd" "$@"
1482 # release building goes here
1484 #"$SELF" each git clean -fxd
1485 case "$RELEASETYPE" in
1487 $ECHO >&2 -n "$ESC[2J$ESC[H"
1494 msg " +---------------------------------------------------------.---+"
1496 msg " +---------------------------------------------------------^---+"
1498 msg " | / \ This is the official release build system. |"
1499 msg " | | | If you are not a member of the Xonotic Core Team, |"
1500 msg " | | STOP | you are not supposed to use this script and should |"
1501 msg " | | | instead use ./all compile to compile the engine |"
1502 msg " | \____/ and game code. |"
1504 msg " | [ I understand ] |"
1505 msg " +-------------------------------------------------------------+"
1507 # A LOT of build infrastructure is required:
1510 # - .ssh/config must be configured so the following
1511 # host names are reachable and have a compile
1512 # infrastructure set up:
1513 # - xonotic-build-linux32 (with gcc on x86)
1514 # - xonotic-build-linux64 (with gcc on x86_64)
1515 # - xonotic-build-win32 (with i586-mingw32msvc-g++)
1516 # - xonotic-build-win64 (with amd64-mingw32msvc-g++
1517 # and x86_64-w64-mingw32-g++)
1518 # - xonotic-build-osx (with Xcode and SDL.framework)
1519 # - AMD Compressonator installed in WINE
1520 # - ResEdit installed in WINE
1521 # - a lot of other requirements you will figure out
1522 # while reading the error messages
1523 # - environment variable RELEASETYPE set
1524 # - optionally, environment variable RELEASEDATE set
1529 msg "Building a FINISHED RELEASE"
1532 msg "Building a $RELEASETYPE"
1535 verbose rm -rf Xonotic Xonotic*.zip
1536 verbose mkdir -p Xonotic
1537 if [ -n "$RELEASEDATE" ]; then
1538 verbose $ECHO "$RELEASEDATE" > Xonotic/stamp.txt
1540 verbose date +%Y%m%d > Xonotic/stamp.txt
1542 verbose git archive --format=tar HEAD -- Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh misc/buildfiles key_0.d0pk | {
1544 verbose mkdir data fteqcc source source/darkplaces source/fteqcc source/d0_blind_id mapping
1546 verbose rm -rf misc/builddeps
1547 verbose mv misc/buildfiles/win32/* . || true
1548 verbose mv misc/buildfiles/win64 bin64 || true
1549 verbose mv misc/buildfiles/osx/* . || true
1550 verbose rm -rf misc/buildfiles
1551 verbose rm -rf misc/pki
1554 verbose cd darkplaces
1555 verbose git archive --format=tar HEAD
1557 verbose cd Xonotic/source/darkplaces
1562 verbose git archive --format=tar HEAD
1564 verbose cd Xonotic/source/fteqcc
1568 verbose cd data/xonotic-data.pk3dir
1569 verbose git archive --format=tar HEAD -- qcsrc Makefile
1571 verbose cd Xonotic/source
1575 verbose cd d0_blind_id
1576 verbose git archive --format=tar HEAD
1578 verbose cd Xonotic/source/d0_blind_id
1580 verbose sh autogen.sh
1582 rm -f Xonotic/key_15.d0pk
1584 verbose cd Xonotic/mapping
1585 verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20110223.tar.bz2
1586 verbose wget http://www.icculus.org/netradiant/files/netradiant-1.5.0-20110223-win32-7z.exe
1587 for X in *-7z.exe; do
1591 # TODO possibly include other tools?
1594 release-compile-run)
1603 if [ -n "$targetfiles" ]; then
1604 case " $HOSTS_THAT_ARE_DISABLED " in
1609 case " $HOSTS_THAT_ARE_MYSELF " in
1611 verbose rsync --delete -zLvaSHP "$srcdir"/ "$buildpath/"
1612 verbose rsync --delete -zLvaSHP "$depsdir"/ "$buildpath.deps/"
1613 verbose ln -snf "$buildpath.deps" "$buildpath/.deps"
1614 verbose eval make -C "$buildpath" clean $maketargets $makeflags
1615 for f in $targetfiles; do
1616 verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
1620 verbose rsync --delete -zLvaSHP "$srcdir"/ "$host:$buildpath/"
1621 verbose rsync --delete -zLvaSHP "$depsdir"/ "$host:$buildpath.deps/"
1622 verbose ssh "$host" "export LC_ALL=C; ln -snf $buildpath.deps $buildpath/.deps && cd $buildpath && nice -`nice` make clean $maketargets $makeflags"
1623 for f in $targetfiles; do
1624 verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
1628 # now rebrand the binaries...
1629 for f in $targetfiles; do
1630 #verbose "$d0/misc/tools/rebrand-darkplaces-engine.sh" "${XONOTIC_BRAND:-$d0/misc/tools/xonotic.brand}" "${f##*:}" || true
1632 Xonotic/xonotic*.exe)
1633 verbose "$d0/misc/tools/change-icon-of-exe.sh" "$d0/misc/logos/icons_ico/xonotic.ico" "${f##*:}"
1642 fteqcc_maketargets=$3
1644 darkplaces_maketargets=$5
1646 host=xonotic-build-$suffix
1647 verbose "$SELF" release-compile-run "$host" /tmp/fteqcc.build."$suffix" "$fteqcc_maketargets" "$makeflags" "Xonotic/source/fteqcc" "$d0/misc/builddeps/dp.$suffix" "$fteqcc_files"
1648 verbose "$SELF" release-compile-run "$host" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$d0/misc/builddeps/dp.$suffix" "$darkplaces_files"
1650 release-engine-win32)
1651 verbose "$SELF" release-compile win32 \
1652 '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' \
1653 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc.exe' \
1655 verbose "$SELF" release-compile win32 \
1656 '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' \
1658 release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
1660 release-engine-win64)
1661 verbose "$SELF" release-compile win64 \
1662 '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' \
1663 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc-x64.exe' \
1664 'sv-release sdl-release' 'darkplaces-sdl.exe:Xonotic/xonotic-x64-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-x64-dedicated.exe'
1665 verbose "$SELF" release-compile win64 \
1666 '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' \
1668 cl-release 'darkplaces.exe:Xonotic/xonotic-x64.exe'
1671 # gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
1672 verbose "$SELF" release-compile osx \
1673 '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"' \
1674 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.osx' \
1675 'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic-SDL.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
1676 verbose "$SELF" release-compile osx \
1677 '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"' \
1679 'cl-release' 'darkplaces-agl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-agl-bin'
1681 release-engine-linux32)
1682 verbose "$SELF" release-compile linux32 \
1683 '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' \
1684 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux32' \
1685 release 'darkplaces-glx:Xonotic/xonotic-linux32-glx darkplaces-sdl:Xonotic/xonotic-linux32-sdl darkplaces-dedicated:Xonotic/xonotic-linux32-dedicated'
1687 release-engine-linux64)
1688 verbose "$SELF" release-compile linux64 \
1689 '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' \
1690 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux64' \
1691 release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
1694 verbose "$SELF" release-engine-linux32 &
1695 verbose "$SELF" release-engine-linux64 &
1696 verbose "$SELF" release-engine-win32 &
1697 verbose "$SELF" release-engine-win64 &
1698 verbose "$SELF" release-engine-osx &
1707 verbose "$SELF" update-maps
1710 verbose make -C Xonotic/source FTEQCC="../../../fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all
1711 verbose rm -f Xonotic/source/qcsrc/*/fteqcc.log
1713 release-buildpk3-transform-raw)
1716 release-buildpk3-transform-normal)
1719 # texture: convert to jpeg and dds
1720 verbose export do_jpeg=true
1721 verbose export jpeg_qual_rgb=97
1722 verbose export jpeg_qual_a=99
1723 verbose export do_dds=false
1724 verbose export do_ogg=false
1725 verbose export del_src=true
1726 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1728 release-buildpk3-transform-normaldds)
1731 # texture: convert to jpeg and dds
1732 # music: reduce bitrate
1733 verbose export do_jpeg=false
1734 verbose export do_jpeg_if_not_dds=true
1735 verbose export jpeg_qual_rgb=95
1736 verbose export jpeg_qual_a=99
1737 verbose export do_dds=true
1738 verbose export dds_flags=
1739 verbose export do_ogg=true
1740 verbose export del_src=true
1741 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1743 release-buildpk3-transform-low)
1746 # texture: convert to jpeg and dds
1747 # music: reduce bitrate
1748 verbose export do_jpeg=true
1749 verbose export jpeg_qual_rgb=80
1750 verbose export jpeg_qual_a=97
1751 verbose export do_dds=false
1752 verbose export do_ogg=true
1753 verbose export ogg_qual=1
1754 verbose export del_src=true
1755 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1757 release-buildpk3-transform-lowdds)
1760 # texture: convert to jpeg and dds
1761 # music: reduce bitrate
1762 verbose export do_jpeg=false
1763 verbose export do_jpeg_if_not_dds=true
1764 verbose export jpeg_qual_rgb=80
1765 verbose export jpeg_qual_a=99
1766 verbose export do_dds=true
1767 verbose export dds_flags=
1768 verbose export do_ogg=true
1769 verbose export ogg_qual=1
1770 verbose export del_src=true
1771 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1784 verbose rm -rf Xonotic/temp
1785 verbose mkdir -p Xonotic/temp
1788 verbose git archive --format=tar HEAD
1790 verbose cd Xonotic/temp
1793 verbose cd Xonotic/temp
1794 if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
1795 verbose cp ../source/progs.dat .
1796 verbose cp ../source/csprogs.dat .
1797 verbose cp ../source/menu.dat .
1798 verbose rm -rf qcsrc
1799 gv=`grep "^gameversion " "defaultXonotic.cfg" | awk '{ print $2 }'`
1800 major=$(($gv / 10000))
1801 minor=$((($gv / 100) - ($major * 100)))
1802 patch=$(($gv - ($major * 10000) - ($minor * 100)))
1803 versionstr="$major.$minor.$patch"
1804 case "$RELEASETYPE" in
1808 versionstr="$versionstr$RELEASETYPE"
1812 s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
1813 s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
1814 s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
1815 " defaultXonotic.cfg
1816 case "$RELEASETYPE" in
1818 echo "" >> defaultXonotic.cfg
1819 echo "// nicer menu" >> defaultXonotic.cfg
1820 echo "set menu_watermark \"\"" >> defaultXonotic.cfg
1824 verbose cd gfx/menu/luminos
1825 verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg .
1826 verbose "$d0"/mediasource/gfx/menu/luminos_versionbuilder/versionbuilder "$versionstr"
1827 verbose rm background_l2.svg
1830 if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
1831 for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
1832 if [ -f "$X" ]; then
1834 verbose rm -f maps/*.log maps/*.irc maps/*.lin
1838 verbose export git_src_repo="$d0/$src" # skip hash-object
1839 verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
1840 verbose mkzipr "../../$dst" *
1842 verbose rm -rf Xonotic/temp
1845 stamp=`cat Xonotic/stamp.txt`
1851 dst="data/xonotic-$stamp-${dst#data/xonotic-}"
1857 while [ "$#" -gt 1 ]; do
1858 verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
1864 verbose "$SELF" release-buildpk3s data/font-nimbussansl.pk3dir raw ''
1865 verbose "$SELF" release-buildpk3s data/font-xolonium.pk3dir raw ''
1866 verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir normal '-high' low '-low' normaldds ''
1867 verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir normal '-high' low '-low' normaldds ''
1868 verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
1869 verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir normal '-high' normaldds ''
1871 release-pack-needsx11)
1874 verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
1877 verbose "$SELF" release-pack
1882 stamp=`cat Xonotic/stamp.txt`
1883 # exe and dll files do not need +x, so this makes them eligible for 7zip compression too
1884 chmod a-x Xonotic/*.exe Xonotic/*.dll || true
1885 # let's pass crypto import laws of some nasty countries
1886 crypto_libs=`find Xonotic -name \*d0_rijndael\*.so -o -name \*d0_rijndael\*.dylib -o -name \*d0_rijndael\*.dll -o -name \*d0_rijndael\*.c`
1887 if [ -n "$crypto_libs" ]; then
1888 verbose mkzip Xonotic-$stamp-crypto.zip \
1892 # build the archives
1893 verbose mkzip Xonotic-$stamp-engine.zip \
1895 Xonotic/bin64/*.dll \
1898 Xonotic/xonotic.exe \
1899 Xonotic/source/darkplaces/
1900 verbose cp Xonotic-$stamp-engine.zip Xonotic-$stamp-common.zip
1901 verbose mkzip Xonotic-$stamp-common.zip \
1902 Xonotic/source/fteqcc/ \
1903 Xonotic/source/qcsrc/ \
1908 Xonotic/key_0.d0pk \
1909 Xonotic/data/font-nimbussansl-$stamp.pk3 \
1910 Xonotic/data/font-xolonium-$stamp.pk3
1911 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
1912 verbose mkzip0 Xonotic-$stamp.zip \
1913 Xonotic/data/xonotic-$stamp-data.pk3 \
1914 Xonotic/data/xonotic-$stamp-maps.pk3 \
1915 Xonotic/data/xonotic-$stamp-music.pk3 \
1916 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1917 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-low.zip
1918 verbose mkzip0 Xonotic-$stamp-low.zip \
1919 Xonotic/data/xonotic-$stamp-data-low.pk3 \
1920 Xonotic/data/xonotic-$stamp-maps-low.pk3 \
1921 Xonotic/data/xonotic-$stamp-music-low.pk3
1922 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
1923 verbose mkzip0 Xonotic-$stamp-high.zip \
1924 Xonotic/data/xonotic-$stamp-data-high.pk3 \
1925 Xonotic/data/xonotic-$stamp-maps-high.pk3 \
1926 Xonotic/data/xonotic-$stamp-music.pk3 \
1927 Xonotic/data/xonotic-$stamp-nexcompat-high.pk3
1928 verbose mkzip Xonotic-$stamp-mappingsupport.zip \
1930 verbose mkzip0 Xonotic-$stamp-mappingsupport.zip \
1931 Xonotic/data/xonotic-$stamp-maps-low.pk3 # TODO add a Radiant build
1934 verbose "$SELF" release-prepare
1935 verbose "$SELF" release-maps
1936 verbose "$SELF" release-engine
1937 verbose "$SELF" release-qc
1938 verbose "$SELF" release-pack-needsx11
1939 verbose "$SELF" release-zip
1944 $ECHO " $SELF admin-merge [<branch>]"
1945 $ECHO " $SELF branch <branch>"
1946 $ECHO " $SELF branch <remote> <branch> [<srcbranch>]"
1947 $ECHO " $SELF branches"
1948 $ECHO " $SELF checkout|switch <branch>"
1949 $ECHO " $SELF checkout|switch <remote>/<branch>"
1950 $ECHO " $SELF clean [-m] [-f | -fu | -fU] [-r] [-D]"
1951 $ECHO " $SELF clean --reclone"
1952 $ECHO " $SELF compile [-c] [-r|-p] [-0]"
1953 $ECHO " $SELF each|foreach [-k] command..."
1954 $ECHO " $SELF fix_upstream_rebase"
1955 $ECHO " $SELF keygen"
1956 $ECHO " $SELF merge"
1957 $ECHO " $SELF push|commit [-s]"
1958 $ECHO " $SELF release"
1959 $ECHO " $SELF restore-patches"
1960 $ECHO " $SELF run [sdl|glx|wgl|agl|dedicated] options..."
1961 $ECHO " $SELF save-patches"
1962 $ECHO " $SELF update-maps"
1963 $ECHO " $SELF update|pull [-N] [-s | -h [-p] | -g [-p]] [-l de|nl|default]"