6 # I use this in EVERY shell script ;)
11 while ! [ -f ./all ]; do
12 if [ x"`pwd`" = x"/" ]; then
13 echo "Cannot find myself."
14 echo "Please run this script with the working directory inside a Xonotic checkout."
22 # If we are on WINDOWS:
27 # Windows hates users. So this script has to copy itself elsewhere first...
28 cp "$SELF" ../all.xonotic.sh
29 export WE_HATE_OUR_USERS=1
30 exec ../all.xonotic.sh "$@"
38 echo >&2 "
\e[1m$*
\e[m"
41 self=`git hash-object "$SELF"`
44 self_new=`git hash-object "$SELF"`
45 if [ x"$self" != x"$self_new" ]; then
46 msg "./all has changed."
47 if [ -z "$XONOTIC_FORBID_RERUN_ALL" ]; then
48 msg "Rerunning the requested operation to make sure."
49 export XONOTIC_FORBID_RERUN_ALL=1
52 msg "Please try $SELF update, and then retry your requested operation."
69 echo "the root directory"
79 if git ls-files -u | grep ' 1 '; then
81 echo "MERGE CONFLICT."
82 echo "change into the \"$1\" project directory, and then:"
83 echo "- edit the files mentioned above with your favorite editor,"
84 echo " and fix the conflicts (marked with <<<<<<< blocks)"
85 echo "- for binary files, you can select the files using"
86 echo " git checkout --ours or git checkout --theirs"
87 echo "- when done with a file, 'git add' the file"
88 echo "- when done, 'git commit'"
97 while [ x"$yesno" != x"y" -a x"$yesno" != x"n" ]; do
108 check_mergeconflict "$1"
113 data/xonotic-data.pk3dir | | master |
114 data/xonotic-music.pk3dir | | master |
115 data/xonotic-nexcompat.pk3dir | | master | no
116 darkplaces | | div0-stable | svn
117 netradiant | | master |
118 div0-gittools | | master | no
119 data/xonotic-maps.pk3dir | | master |
120 mediasource | | master | no
121 fteqcc | git://github.com/Blub/qclib.git | master |
123 # todo: in darkplaces, change repobranch to div0-stable
125 repos=`echo "$repos_urls" | grep . | cut -d '|' -f 1 | tr -d ' '`
127 base=`git config remote.origin.url`
130 base=${base%xonotic.git}
133 echo "The main repo is not xonotic.git, what have you done?"
140 repo_t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 2 | tr -d ' '`
141 if [ -n "$repo_t" ]; then
151 if [ x"$1" = x"." ]; then
152 echo "$base""xonotic.git"
154 echo "$base${1##*/}.git"
161 repo_t=`echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 3 | tr -d ' '`
162 if [ -n "$repo_t" ]; then
171 echo "$repos_urls" | grep "^$1 " | cut -d '|' -f 4 | tr -d ' '
179 # if we have the dir, always keep it
181 msg "Repository $d enabled because it already exists"
185 # if .yes file exists, always keep it
186 if [ -f "$d.yes" ]; then
187 msg "Repository $d enabled by a .yes file"
191 # if we have .no file, skip
192 if [ -f "$d.no" ]; then
193 msg "Repository $d disabled by a .no file, delete $p.no to enable"
196 # if we have matching pk3, skip
197 if [ x"$p" != x"$d" ] && [ -f "$p" ]; then
198 msg "Repository $d disabled by matching .pk3 file, delete $p or create $d.yes to enable"
201 # if "no" flag is set, skip
204 msg "Repository $d disabled by default, create $d.yes to enable"
209 msg "Repository $d enabled by default"
216 if [ "$#" = 0 ]; then
222 fix_upstream_rebase()
224 if [ -z "$r_me" ] || [ -z "$r_other" ]; then
227 r_base=`git merge-base "$r_me" "$r_other"`
229 # no merge-base? upstream did filter-branch
230 if [ -n "$r_base" ]; then
231 # otherwise, check if the two histories are "similar"
232 r_l_me=`git log --pretty="format:%s" "$r_other".."$r_me" | grep -v "^Merge" | sort -u`
233 r_l_other=`git log --pretty="format:%s" "$r_me".."$r_other" | grep -v "^Merge" | sort -u`
235 # heuristics: upstream rebase/filter-branch if more than 50% of the commits of one of the sides are in the other too
236 r_lc_me=`echo "$r_l_me" | wc -l`
237 r_lc_other=`echo "$r_l_other" | wc -l`
238 r_lc_together=`{ echo "$r_l_me"; echo "$r_l_other"; } | sort -u | wc -l`
239 r_lc_same=$(($r_lc_me + $r_lc_other - $r_lc_together))
241 if [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_me )) ] || [ $(( $r_lc_same * 2 )) -gt $(( $r_lc_other )) ]; then
242 if yesno "Probable upstream rebase detected, automatically fix?" 'git log --oneline --graph --date-order --left-right "$r_other"..."$r_me"'; then
243 git reset --hard "$r_me"
253 fix_upstream_rebase_mergeok()
255 r_me=`git rev-parse --revs-only HEAD^1 2>/dev/null || true`
256 r_other=`git rev-parse --revs-only HEAD^2 2>/dev/null || true`
260 fix_upstream_rebase_mergefail()
262 r_me=`git rev-parse --revs-only HEAD 2>/dev/null || true`
263 r_other=`git rev-parse --revs-only MERGE_HEAD 2>/dev/null || true`
269 verbose git config core.autocrlf input
270 if [ -z "`git config push.default`" ]; then
271 verbose git config push.default current # or is tracking better?
280 find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
281 7za a -tzip -mx=9 -x@"$ziplist" "$archive" "$@" || true
282 zip -9y -@<"$ziplist" "$archive" || true
294 enter "$d0/$d" verbose
295 verbose fix_upstream_rebase_mergefail && verbose fix_upstream_rebase_mergeok
300 if [ x"$1" = x"-N" ]; then
305 branch=`repobranch "$d"`
306 if [ -d "$d0/$d" ]; then
308 enter "$d0/$d" verbose
310 verbose git config remote.origin.url "$url"
311 verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
312 r=`git symbolic-ref HEAD`
314 if git config branch.$r.remote >/dev/null 2>&1; then
315 if ! verbose git pull; then
316 fix_upstream_rebase_mergefail || true
317 check_mergeconflict "$d"
318 echo "Pulling failed. Press ENTER to continue, or Ctrl-C to abort."
321 fix_upstream_rebase_mergeok || true
326 checkself "$cmd" "$@"
328 verbose git remote prune origin
332 verbose git clone "$url" "$d0/$d"
333 enter "$d0/$d" verbose
335 if [ "$branch" != "master" ]; then
336 verbose git checkout --track -b "$branch" origin/"$branch"
343 misc/tools/xonotic-map-compiler-autobuild download
347 if [ x"$1" = x"-f" ]; then
353 if [ -z "$branch" ]; then
356 branch=${remote#origin/}
367 enter "$d0/$d" verbose
369 if [ -n "$b" ] && git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
371 verbose git checkout $checkoutflags "$b"
372 elif [ -n "$b" ] && git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
374 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
377 if git rev-parse "refs/heads/$b" >/dev/null 2>&1; then
379 verbose git checkout $checkoutflags "$b"
380 elif git rev-parse "refs/remotes/$remote/$b" >/dev/null 2>&1; then
382 verbose git checkout $checkoutflags --track -b "$b" "$remote/$b"
384 echo "WTF? Not even branch $b doesn't exist in $d"
389 checkself "$cmd" "$@"
393 echo "The requested branch was not found in any repository."
401 if [ -z "$branch" ]; then
405 if [ -z "$branch" ]; then
408 r=`git symbolic-ref HEAD`
415 dv=`visible_repo_name "$d"`
416 enter "$d0/$d" verbose
417 if git rev-parse "refs/heads/$branch" >/dev/null 2>&1; then
418 echo "Already having this branch in $dv."
420 if yesno "Branch in $dv?"; then
421 if [ -n "$srcbranch" ]; then
424 b=origin/"`repobranch "$d"`"
425 verbose git fetch origin || true
427 # TODO do this without pushing
428 verbose git checkout -b "$branch" "$b"
429 verbose git config "branch.$branch.remote" "$remote"
430 verbose git config "branch.$branch.merge" "refs/heads/$branch"
440 cd "$d0/$d" # am in a pipe, shouldn't use enter
441 git branch -r -v -v | cut -c 3- | sed "s/^(no branch)/(no_branch)/" | sed "s,^,$d ,"
446 while read -r d BRANCH REV TEXT; do
447 if [ x"$BRANCH" = x"`repobranch "$d"`" ]; then
450 if [ x"$REV" = x"->" ]; then
453 BRANCH=${BRANCH#remotes/}
454 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
455 branches_list="$branches_list $BRANCH" # TEH SORT MAKEZ IT UNIEQ
456 eval "r=\$branches_repos_$ID"
458 eval "branches_repos_$ID=\$r"
460 echo -n "$branches_list" | xargs -n 1 echo | sort -u | while IFS= read -r BRANCH; do
461 ID=`echo "$BRANCH" | tr -c "A-Za-z0-9." "_"`
462 eval "r=\$branches_repos_$ID"
463 printf "%-60s %s\n" "$BRANCH" "$r"
470 dv=`visible_repo_name "$d"`
471 enter "$d0/$d" verbose
472 r=`git symbolic-ref HEAD`
474 if git log HEAD..origin/"`repobranch "$d"`" | grep .; then
475 # we have uncommitted changes
476 if yesno "Could merge from \"`repobranch "$d"`\" into \"$r\" in $dv. Do it?"; then
477 if ! verbose git merge origin/"`repobranch "$d"`"; then
478 check_mergeconflict "$d"
479 exit 1 # this should ALWAYS be fatal
489 dv=`visible_repo_name "$d"`
490 enter "$d0/$d" verbose
491 r=`git symbolic-ref HEAD`
493 diffdata=`git diff --color HEAD`
494 if [ -n "$diffdata" ]; then
495 # we have uncommitted changes
496 if yesno "Uncommitted changes in \"$r\" in $dv. Commit?" 'echo "$diffdata" | less -r'; then
497 verbose git commit -a
500 rem=`git config "branch.$r.remote" || echo origin`
501 bra=`git config "branch.$r.merge" || echo "$r"`
502 upstream="$rem/${bra#refs/heads/}"
503 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
504 upstream="origin/`repobranch "$d"`"
506 logdata=`git log --color "$upstream".."$r"`
507 if [ -n "$logdata" ]; then
508 if yesno "Push \"$r\" in $dv?" 'echo "$logdata" | less -r'; then
509 verbose git push "$rem" HEAD
512 if [ x"$submit" = x"-s" ]; then
515 verbose git push "$rem" HEAD:"${bra%%/*}/finished/${bra#*/}"
523 if [ -n "$WE_HATE_OUR_USERS" ]; then
524 TARGETS="sv-debug cl-debug"
525 if [ -z "$CC" ]; then
528 elif [ x"`uname`" = x"Darwin" ]; then
531 TARGETS="sv-debug cl-debug sdl-debug"
534 # AGL cannot be compiled on systems with a kernel > 10.x (Snow Leopard)
535 TARGETS="sv-debug sdl-debug"
538 export CC="gcc -I$PWD/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks/SDL.framework/Headers -F$PWD/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
540 TARGETS="sv-debug cl-debug sdl-debug"
555 if [ $# -gt 0 ] && [ x"$1" = x"" ]; then
556 # if we give the command make the arg "", it will surely fail (invalid filename),
557 # so better handle it as an empty client option
560 elif [ -n "$1" ]; then
562 TARGETS_SAVE=$TARGETS
567 TARGETS="$TARGETS sdl-debug"
570 TARGETS="$TARGETS cl-debug"
573 TARGETS="$TARGETS sv-debug"
576 BAD_TARGETS="$BAD_TARGETS $X"
580 if [ -n "$TARGETS" ]; then # at least a valid client
582 else # no valid client, let's assume this option is not meant to be a client then
583 TARGETS=$TARGETS_SAVE
587 if [ -z "$MAKEFLAGS" ]; then
588 if [ -f /proc/cpuinfo ]; then
589 ncpus=$((`grep -c '^processor :' /proc/cpuinfo`+0))
590 if [ $ncpus -gt 1 ]; then
594 if [ -n "$WE_HATE_OUR_USERS" ]; then
595 MAKEFLAGS="$MAKEFLAGS DP_MAKE_TARGET=mingw LIB_JPEG= CFLAGS_LIBJPEG="
599 enter "$d0/fteqcc" verbose
601 verbose make $MAKEFLAGS clean
603 verbose make $MAKEFLAGS
605 enter "$d0/data/xonotic-data.pk3dir" verbose
607 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS clean
609 verbose make FTEQCC="$d0/fteqcc/fteqcc.bin" "$@" $MAKEFLAGS
611 enter "$d0/darkplaces" verbose
612 if [ x"$BAD_TARGETS" = x" " ]; then
613 echo "Warning: invalid empty client, default clients will be used."
616 verbose make $MAKEFLAGS clean
618 for T in $TARGETS; do
619 verbose make $MAKEFLAGS "$@" "$T"
621 for T in $BAD_TARGETS; do
622 echo "Warning: discarded invalid client $T."
625 verbose "$SELF" update-maps
628 if [ -n "$WE_HATE_OUR_USERS" ]; then
630 export PATH="$d0/misc/buildfiles/win32:$PATH"
631 elif [ x"`uname`" = x"Darwin" ]; then
632 export DYLD_LIBRARY_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/MacOS"
633 export DYLD_FRAMEWORK_PATH="$d0/misc/buildfiles/osx/Xonotic-SDL.app/Contents/Frameworks"
639 sdl|glx|agl|dedicated)
648 if ! [ -x "darkplaces/darkplaces$client" ]; then
649 if [ -x "darkplaces/darkplaces$client.exe" ]; then
652 echo "Client darkplaces/darkplaces$client not found, aborting"
656 set -- "darkplaces/darkplaces$client" -nexuiz -customgamename Xonotic -customgamedirname1 data -customgamedirname2 "" -customgamescreenshotname xonotic -customgameuserdirname xonotic -mygames "$@"
658 #set -- "darkplaces/darkplaces$client" -xonotic -mygames "$@"
660 # if pulseaudio is running: USE IT
661 if [ -z "$SDL_AUDIODRIVER" ] && ! [ -n "$WE_HATE_OUR_USERS" ] && ! [ x"`uname`" = x"Darwin" ]; then
662 if ps -C pulseaudio >/dev/null; then
663 if ldd /usr/lib/libSDL.so 2>/dev/null | grep pulse >/dev/null; then
664 export SDL_AUDIODRIVER=pulse
669 if [ -n "$USE_GDB" ]; then
670 set -- gdb --args "$@"
671 elif which catchsegv >/dev/null 2>&1/; then
672 set -- catchsegv "$@"
678 if [ x"$1" = x"-k" ]; then
683 if verbose cd "$d0/$d"; then
695 patchdir=`mktemp -d -t save-patches.XXXXXX`
697 enter "$d0/$d" verbose
698 git branch -v -v | cut -c 3- | {
700 while read -r BRANCH REV UPSTREAM TEXT; do
703 UPSTREAM=${UPSTREAM#\[}
704 UPSTREAM=${UPSTREAM%\]}
705 UPSTREAM=${UPSTREAM%:*}
709 UPSTREAM=origin/"`repobranch "$d"`"
713 if [ x"$REV" = x"->" ]; then
716 if git format-patch -o "$patchdir/$i" "$UPSTREAM".."$BRANCH"; then
717 echo "$d" > "$patchdir/$i/info.txt"
718 echo "$BRANCH" >> "$patchdir/$i/info.txt"
719 echo "$UPSTREAM" >> "$patchdir/$i/info.txt"
720 echo "$TRACK" >> "$patchdir/$i/info.txt"
723 rm -rf "$patchdir/$i"
728 ( cd "$patchdir" && tar cvzf - . ) > "$outfile"
733 patchdir=`mktemp -d -t restore-patches.XXXXXX`
734 ( cd "$patchdir" && tar xvzf - ) < "$infile"
736 for P in "$patchdir"/*/info.txt; do
743 verbose git checkout HEAD^0
744 verbose git branch -D "$BRANCH"
745 if [ x"$TRACK" = x"true" ]; then
746 verbose git checkout --track -b "$BRANCH" "$UPSTREAM"
748 verbose git branch -b "$BRANCH" "$UPSTREAM"
760 report=$report"$*$LF"
765 report=$report" $*$LF"
770 o=`"$@" | sed 's/^/ /' || true`
774 enter "$d0/$d" verbose
775 base="`repobranch "$d"`"
777 for ref in `git for-each-ref --format='%(refname)' refs/remotes/origin/`; do
778 case "${ref#refs/remotes/origin/}" in
791 if [ -n "$branch" ]; then
792 if [ x"$branch" != x"${ref#refs/remotes/origin/}" ]; then
801 l0=`git rev-list "$base".."$ref" | wc -l`
802 l1=`git rev-list master.."$ref" | wc -l`
803 if [ $l0 -gt $l1 ]; then
810 reportecho " Branch $ref:"
811 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
812 logdata=`git log --color "$realbase".."$ref"`
813 if [ -z "$logdata" ]; then
814 reportecho4 "--> not merging, no changes vs master"
815 if yesno "Branch \"$ref\" probably should get deleted. Do it?" ''; then
816 git push origin :"${ref#refs/remotes/origin/}"
817 reportecho4 "--> branch deleted"
820 diffdata=`git diff --color --find-copies-harder --ignore-space-change "$realbase"..."$ref"`
821 if [ -z "$diffdata" ]; then
822 reportecho4 "--> not merging, no changes vs master, branch contains redundant history"
823 if yesno "Branch \"$ref\" probably should get deleted. Do it?" '{ echo "$logdata"; } | less -r'; then
824 git push origin :"${ref#refs/remotes/origin/}"
825 reportecho4 "--> branch deleted"
827 elif [ -z "$branch" ] && [ -n "$note" ]; then
828 reportdo4 echo "$note"
829 reportecho4 "--> not merging, already had this one rejected before"
830 elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ echo "$logdata"; echo "$diffdata"; } | less -r'; then
831 git checkout "$realbase"
832 org=`git rev-parse HEAD`
833 if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
834 git reset --hard "$org"
835 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
837 reportecho4 "--> merge failed"
838 elif ! "$SELF" compile 2>&1 | tee "$t"; then
839 git reset --hard "$org"
840 GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Compile failed:$LF`cat "$t"`" "$ref"
842 reportecho4 "--> compile failed"
843 elif ! yesno "Still merge \"$ref\" into `git symbolic-ref HEAD` of $d? Maybe you want to test first."; then
844 git reset --hard "$org"
845 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
846 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
847 if [ x"$note" = x"del" ]; then
848 git push origin :"${ref#refs/remotes/origin/}"
849 reportecho4 "--> test failed, branch deleted"
850 elif [ -n "$note" ]; then
851 reportdo4 echo "$note"
852 reportecho4 "--> test failed"
854 reportecho4 "--> test failed, postponed"
858 case ",`repoflags "$d"`," in
860 # we do quite a mess here... luckily we know $org
861 git fetch # svn needs to be current
862 git rebase -i --onto origin/master "$org"
863 git svn dcommit --add-author-from
864 git reset --hard "$org"
870 reportecho4 "--> MERGED"
871 if yesno "Delete original branch \"$ref\"?"; then
872 git push origin :"${ref#refs/remotes/origin/}"
873 reportecho4 "--> branch deleted"
877 GIT_NOTES_REF=refs/notes/admin-merge git notes edit "$ref"
878 note=`GIT_NOTES_REF=refs/notes/admin-merge git notes show "$ref" 2>/dev/null || true`
879 if [ x"$note" = x"del" ]; then
880 git push origin :"${ref#refs/remotes/origin/}"
881 reportecho4 "--> branch deleted"
882 elif [ -n "$note" ]; then
883 reportdo4 echo "$note"
884 reportecho4 "--> rejected"
886 reportecho4 "--> postponed"
895 echo "$report" | ssh nexuiz@rm.endoftheinternet.org cat '>>' public_html/xonotic-merge-notes.txt
905 # ./all clean [-m] [-f | -fu | -fU] [-r] [-D]
906 # ./all clean --reclone
909 if [ x"$1" = x"--reclone" ]; then
916 elif [ x"$1" = x"-f" ]; then
918 elif [ x"$1" = x"-u" ]; then
920 elif [ x"$1" = x"-U" ]; then
923 elif [ x"$1" = x"-fu" ]; then
926 elif [ x"$1" = x"-fU" ]; then
930 elif [ x"$1" = x"-m" ]; then
932 elif [ x"$1" = x"-r" ]; then
934 elif [ x"$1" = x"-D" ]; then
947 if $gotoupstream; then
949 msg "Must also use -f (delete local changes) when using -u"
953 if $fetchupstream; then
954 verbose git fetch origin
955 verbose git remote prune origin
957 verbose git checkout -f "`repobranch "$d"`"
958 verbose git reset --hard origin/"`repobranch "$d"`"
960 r=`git symbolic-ref HEAD`
962 rem=`git config "branch.$r.remote" || echo origin`
963 bra=`git config "branch.$r.merge" || echo "$r"`
964 upstream="$rem/${bra#refs/heads/}"
965 if $fetchupstream; then
966 verbose git fetch "$rem"
967 verbose git remote prune "$rem"
969 if ! git rev-parse "$upstream" >/dev/null 2>&1; then
970 upstream="origin/`repobranch "$d"`"
972 verbose git reset --hard "$upstream"
974 elif $gotomaster; then
976 verbose git checkout -f "`repobranch "$d"`"
977 verbose git reset --hard
979 verbose git checkout "`repobranch "$d"`"
982 verbose git reset --hard
984 if $rmuntracked; then
987 verbose git clean -df
990 verbose git clean -xdf
994 if $killbranches; then
995 git for-each-ref --format='%(refname)' refs/heads/ | while IFS= read -r B; do
996 if [ x"$B" != x"`git symbolic-ref HEAD`" ]; then
997 verbose git branch -D "${B#refs/heads/}"
1004 # release building goes here
1006 #"$SELF" each git clean -fxd
1007 case "$RELEASETYPE" in
1009 msg "Building a BETA"
1012 msg "Building a RELEASE"
1015 msg "Must either set RELEASETYPE=beta or RELEASETYPE=release"
1019 verbose rm -rf Xonotic Xonotic*.zip
1020 verbose mkdir -p Xonotic
1021 if [ -n "$RELEASEDATE" ]; then
1022 verbose echo "$RELEASEDATE" > Xonotic/stamp.txt
1024 verbose date +%Y%m%d > Xonotic/stamp.txt
1026 verbose git archive --format=tar HEAD -- Docs misc server xonotic-linux-glx.sh xonotic-linux-sdl.sh misc/buildfiles | {
1028 verbose mkdir data fteqcc source source/darkplaces source/fteqcc
1030 verbose rm -rf misc/builddeps
1031 verbose mv misc/buildfiles/win32/* . || true
1032 verbose mv misc/buildfiles/win64 bin64 || true
1033 verbose mv misc/buildfiles/osx/* . || true
1034 verbose rm -rf misc/buildfiles
1037 verbose cd darkplaces
1038 verbose git archive --format=tar HEAD
1040 verbose cd Xonotic/source/darkplaces
1045 verbose git archive --format=tar HEAD
1047 verbose cd Xonotic/source/fteqcc
1051 verbose cd data/xonotic-data.pk3dir
1052 verbose git archive --format=tar HEAD -- qcsrc Makefile
1054 verbose cd Xonotic/source
1058 release-compile-run)
1067 if [ -n "$targetfiles" ]; then
1068 case " $HOSTS_THAT_ARE_DISABLED " in
1073 case " $HOSTS_THAT_ARE_MYSELF " in
1075 verbose rsync --delete -zLvaSHP "$srcdir"/ "$buildpath/"
1076 verbose rsync --delete -zLvaSHP "$depsdir"/ "$buildpath.deps/"
1077 verbose ln -snf "$buildpath.deps" "$buildpath/.deps"
1078 verbose eval make -C "$buildpath" clean $maketargets $makeflags
1079 for f in $targetfiles; do
1080 verbose mv "$buildpath/${f%:*}" "${f##*:}" || true
1084 verbose rsync --delete -zLvaSHP "$srcdir"/ "$host:$buildpath/"
1085 verbose rsync --delete -zLvaSHP "$depsdir"/ "$host:$buildpath.deps/"
1086 verbose ssh "$host" "ln -snf $buildpath.deps $buildpath/.deps && cd $buildpath && nice -`nice` make clean $maketargets $makeflags"
1087 for f in $targetfiles; do
1088 verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
1092 # now rebrand the binaries...
1093 for f in $targetfiles; do
1094 #verbose "$d0/misc/tools/rebrand-darkplaces-engine.sh" "${XONOTIC_BRAND:-$d0/misc/tools/xonotic.brand}" "${f##*:}" || true
1097 verbose "$d0/misc/tools/change-icon-of-exe.sh" "$d0/misc/logos/icons_ico/xonotic.ico" "$f"
1099 d=`mktemp -d -t rebrand.XXXXXX`
1101 echo "-mygames" > darkplaces.opt
1102 zip -9r darkplaces.zip darkplaces.opt
1115 fteqcc_maketargets=$3
1117 darkplaces_maketargets=$5
1119 host=xonotic-build-$suffix
1120 verbose "$SELF" release-compile-run "$host" /tmp/fteqcc.build."$suffix" "$fteqcc_maketargets" "$makeflags" "Xonotic/source/fteqcc" "$d0/misc/builddeps/dp.$suffix" "$fteqcc_files"
1121 verbose "$SELF" release-compile-run "$host" /tmp/Darkplaces.build."$suffix" "$darkplaces_maketargets" "$makeflags" "Xonotic/source/darkplaces" "$d0/misc/builddeps/dp.$suffix" "$darkplaces_files"
1123 release-engine-win32)
1124 verbose "$SELF" release-compile win32 \
1125 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN32RELEASE=1 D3D=0' \
1126 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc.exe' \
1128 verbose "$SELF" release-compile win32 \
1129 'STRIP=: DP_MAKE_TARGET=mingw CC="i586-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib" WINDRES="i586-mingw32msvc-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN32RELEASE=1 D3D=0' \
1131 release 'darkplaces.exe:Xonotic/xonotic.exe darkplaces-sdl.exe:Xonotic/xonotic-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-dedicated.exe'
1133 release-engine-win64)
1134 verbose "$SELF" release-compile win64 \
1135 'STRIP=: DP_MAKE_TARGET=mingw CC="amd64-mingw32msvc-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib" WINDRES="amd64-mingw32msvc-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN64RELEASE=1 D3D=0' \
1136 win 'fteqcc.exe:Xonotic/fteqcc/fteqcc-x64.exe' \
1137 'sv-release sdl-release' 'darkplaces-sdl.exe:Xonotic/xonotic-x64-sdl.exe darkplaces-dedicated.exe:Xonotic/xonotic-x64-dedicated.exe'
1138 verbose "$SELF" release-compile win64 \
1139 'STRIP=: DP_MAKE_TARGET=mingw CC="x86_64-w64-mingw32-gcc -g -Wl,--dynamicbase -Wl,--nxcompat -I.deps/include -L.deps/lib" WINDRES="x86_64-w64-mingw32-windres" SDL_CONFIG=".deps/bin/sdl-config" LIB_JPEG= CFLAGS_LIBJPEG= WIN64RELEASE=1 D3D=0' \
1141 cl-release 'darkplaces.exe:Xonotic/xonotic-x64.exe'
1144 # gcc on OSX is buggy, needs -fno-reorder-blocks for a release build to succeed
1145 verbose "$SELF" release-compile osx \
1146 '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"' \
1147 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.osx' \
1148 'sv-release sdl-release' 'darkplaces-sdl:Xonotic/Xonotic-SDL.app/Contents/MacOS/xonotic-osx-sdl-bin darkplaces-dedicated:Xonotic/xonotic-osx-dedicated'
1149 verbose "$SELF" release-compile osx \
1150 '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"' \
1152 'cl-release' 'darkplaces-agl:Xonotic/Xonotic.app/Contents/MacOS/xonotic-osx-agl-bin'
1154 release-engine-linux32)
1155 verbose "$SELF" release-compile linux32 \
1156 'STRIP=: CC="gcc -m32 -g -I.deps/include -L.deps/lib" DP_MODPLUG_STATIC_LIBDIR=.deps/lib LIB_JPEG=.deps/lib/libjpeg.a' \
1157 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux32' \
1158 release 'darkplaces-glx:Xonotic/xonotic-linux32-glx darkplaces-sdl:Xonotic/xonotic-linux32-sdl darkplaces-dedicated:Xonotic/xonotic-linux32-dedicated'
1160 release-engine-linux64)
1161 verbose "$SELF" release-compile linux64 \
1162 'STRIP=: CC="gcc -m64 -g -I.deps/include -L.deps/lib" DP_MODPLUG_STATIC_LIBDIR=.deps/lib LIB_JPEG=.deps/lib/libjpeg.a' \
1163 all 'fteqcc.bin:Xonotic/fteqcc/fteqcc.linux64' \
1164 release 'darkplaces-glx:Xonotic/xonotic-linux64-glx darkplaces-sdl:Xonotic/xonotic-linux64-sdl darkplaces-dedicated:Xonotic/xonotic-linux64-dedicated'
1167 verbose "$SELF" release-engine-linux32 &
1168 verbose "$SELF" release-engine-linux64 &
1169 verbose "$SELF" release-engine-win32 &
1170 verbose "$SELF" release-engine-win64 &
1171 verbose "$SELF" release-engine-osx &
1180 verbose "$SELF" update-maps
1183 case "$RELEASETYPE" in
1185 verbose make -C Xonotic/source FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 clean all
1188 verbose make -C Xonotic/source FTEQCC="$d0/Xonotic/fteqcc/fteqcc.linux32" XON_BUILDSYSTEM=1 FTEQCCFLAGS_WATERMARK= clean all
1191 verbose rm -f Xonotic/source/*/fteqcc.log
1193 release-buildpk3-transform-raw)
1196 release-buildpk3-transform-normal)
1199 # texture: convert to jpeg and dds
1200 verbose export do_jpeg=true
1201 verbose export jpeg_qual_rgb=95
1202 verbose export jpeg_qual_a=99
1203 verbose export do_dds=true
1204 verbose export dds_flags=
1205 verbose export do_ogg=false
1206 verbose export del_src=true
1207 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1209 release-buildpk3-transform-low)
1212 # texture: convert to jpeg and dds
1213 # music: reduce bitrate
1214 verbose export do_jpeg=true
1215 verbose export jpeg_qual_rgb=80
1216 verbose export jpeg_qual_a=95
1217 verbose export do_dds=false
1218 verbose export do_ogg=true
1219 verbose export ogg_qual=1
1220 verbose export del_src=true
1221 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1223 release-buildpk3-transform-lowdds)
1226 # texture: convert to jpeg and dds
1227 # music: reduce bitrate
1228 verbose export do_jpeg=false
1229 verbose export do_jpeg_if_not_dds=true
1230 verbose export jpeg_qual_rgb=80
1231 verbose export jpeg_qual_a=95
1232 verbose export do_dds=true
1233 verbose export dds_flags=
1234 verbose export do_ogg=true
1235 verbose export ogg_qual=1
1236 verbose export del_src=true
1237 find . -type f -print0 | verbose xargs -0 "$d0"/misc/tools/cached-converter.sh
1250 verbose rm -rf Xonotic/temp
1251 verbose mkdir -p Xonotic/temp
1254 verbose git archive --format=tar HEAD
1256 verbose cd Xonotic/temp
1259 verbose cd Xonotic/temp
1260 if [ x"$src" = x"data/xonotic-data.pk3dir" ]; then
1261 verbose cp ../source/progs.dat .
1262 verbose cp ../source/csprogs.dat .
1263 verbose cp ../source/menu.dat .
1264 verbose rm -rf qcsrc
1265 gv=`grep "^gameversion " "defaultXonotic.cfg" | awk '{ print $2 }'`
1266 major=$(($gv / 10000))
1267 minor=$(($gv / 100 - $major * 100))
1268 patch=$(($gv - $major * 10000 - $minor * 100))
1269 versionstr="$major.$minor.$patch"
1270 case "$RELEASETYPE" in
1272 versionstr="$versionstr""beta"
1276 s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
1277 s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
1278 s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
1279 " defaultXonotic.cfg
1281 verbose cd gfx/menu/luminos
1282 verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg .
1283 verbose "$d0"/mediasource/gfx/menu/luminos_versionbuilder/versionbuilder "$versionstr"
1284 verbose rm background_l2.svg
1287 if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
1288 for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
1289 if [ -f "$X" ]; then
1291 verbose rm -f maps/*.log maps/*.irc maps/*.lin
1295 verbose export git_src_repo="$d0/$src" # skip hash-object
1296 verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
1297 verbose mkzip "../../$dst" *
1299 verbose rm -rf Xonotic/temp
1302 stamp=`cat Xonotic/stamp.txt`
1308 dst="data/xonotic-$stamp-${dst#data/xonotic-}"
1314 while [ "$#" -gt 1 ]; do
1315 verbose "$SELF" release-buildpk3 "$src" "Xonotic/$dst$2.pk3" "$1"
1321 verbose "$SELF" release-buildpk3s data/font-nimbussansl.pk3dir raw ''
1322 verbose "$SELF" release-buildpk3s data/xonotic-data.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
1323 verbose "$SELF" release-buildpk3s data/xonotic-maps.pk3dir normal '' raw '-raw' low '-low' lowdds '-lowdds'
1324 verbose "$SELF" release-buildpk3s data/xonotic-music.pk3dir raw '' low '-low'
1325 verbose "$SELF" release-buildpk3s data/xonotic-nexcompat.pk3dir low ''
1327 release-pack-needsx11)
1330 verbose startx "$SELF" release-pack -- /usr/bin/Xvfb :7
1333 verbose "$SELF" release-pack
1338 stamp=`cat Xonotic/stamp.txt`
1339 # exe and dll files do not need +x, so this makes them eligible for 7zip compression too
1340 chmod a-x Xonotic/*.exe Xonotic/*.dll || true
1341 # need to use infozip for these (+x bits)
1342 verbose mkzip Xonotic-$stamp-engine.zip \
1344 Xonotic/bin64/*.dll \
1347 Xonotic/xonotic.exe \
1348 Xonotic/source/darkplaces/
1349 verbose cp Xonotic-$stamp-engine.zip Xonotic-$stamp-common.zip
1350 verbose mkzip Xonotic-$stamp-common.zip \
1351 Xonotic/source/fteqcc/ \
1352 Xonotic/source/qcsrc/ \
1357 Xonotic/data/font-nimbussansl-$stamp.pk3
1358 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
1359 verbose mkzip0 Xonotic-$stamp.zip \
1360 Xonotic/data/xonotic-$stamp-data.pk3 \
1361 Xonotic/data/xonotic-$stamp-maps.pk3 \
1362 Xonotic/data/xonotic-$stamp-music.pk3 \
1363 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1364 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-low.zip
1365 verbose mkzip0 Xonotic-$stamp-low.zip \
1366 Xonotic/data/xonotic-$stamp-data-low.pk3 \
1367 Xonotic/data/xonotic-$stamp-maps-low.pk3 \
1368 Xonotic/data/xonotic-$stamp-music-low.pk3
1369 verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-lowdds.zip
1370 verbose mkzip0 Xonotic-$stamp-lowdds.zip \
1371 Xonotic/data/xonotic-$stamp-data-lowdds.pk3 \
1372 Xonotic/data/xonotic-$stamp-maps-lowdds.pk3 \
1373 Xonotic/data/xonotic-$stamp-music-low.pk3
1374 verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
1375 verbose mkzip0 Xonotic-$stamp-high.zip \
1376 Xonotic/data/xonotic-$stamp-data-raw.pk3 \
1377 Xonotic/data/xonotic-$stamp-maps-raw.pk3 \
1378 Xonotic/data/xonotic-$stamp-music.pk3 \
1379 Xonotic/data/xonotic-$stamp-nexcompat.pk3
1382 verbose "$SELF" release-prepare
1383 verbose "$SELF" release-maps
1384 verbose "$SELF" release-engine
1385 verbose "$SELF" release-qc
1386 verbose "$SELF" release-pack-needsx11
1387 verbose "$SELF" release-zip
1392 echo " $SELF admin-merge [<branch>]"
1393 echo " $SELF branch <branch>"
1394 echo " $SELF branch <remote> <branch> [<srcbranch>]"
1395 echo " $SELF branches"
1396 echo " $SELF checkout|switch <branch>"
1397 echo " $SELF checkout|switch <remote>/<branch>"
1398 echo " $SELF clean [-m] [-f | -fu | -fU] [-r] [-D]"
1399 echo " $SELF clean --reclone"
1400 echo " $SELF compile [-c]"
1401 echo " $SELF each|foreach [-k] command..."
1402 echo " $SELF fix_upstream_rebase"
1404 echo " $SELF push|commit [-s]"
1405 echo " $SELF release"
1406 echo " $SELF restore-patches"
1407 echo " $SELF run [sdl|glx|wgl|agl|dedicated] options..."
1408 echo " $SELF save-patches"
1409 echo " $SELF update-maps"
1410 echo " $SELF update|pull [-N]"