Merge remote branch 'origin/master' into divVerent/crypto2
authorRudolf Polzer <divverent@alientrap.org>
Fri, 17 Sep 2010 05:37:59 +0000 (07:37 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 17 Sep 2010 05:37:59 +0000 (07:37 +0200)
all
misc/tools/cached-converter.sh
misc/tools/update-nexcompat.sh
misc/tools/xonotic-map-compiler-autobuild
server/rcon.pl
server/rcon2irc/rcon2irc.pl

diff --git a/all b/all
index fff4d56..2592fde 100755 (executable)
--- a/all
+++ b/all
@@ -273,6 +273,22 @@ fix_git_config()
        fi
 }
 
+mkzip()
+{
+       archive=$1
+       shift
+       ziplist=`mktemp`
+       find "$@" -xtype f \( -executable -or -type l \) -print > "$ziplist"
+       7za a -tzip -mx=9 -x@"$ziplist" "$archive" "$@" || true
+       zip         -9y   -@<"$ziplist" "$archive"      || true
+       rm -f "$ziplist"
+}
+
+mkzip0()
+{
+       zip -0y "$@"
+}
+
 case "$cmd" in
        fix_upstream_rebase)
                for d in $repos; do
@@ -994,7 +1010,13 @@ case "$cmd" in
                srcdir=$5
                depsdir=$6
                targetfiles=$7
+               set -x
                if [ -n "$targetfiles" ]; then
+                       case " $HOSTS_THAT_ARE_DISABLED " in
+                               *\ $host\ *)
+                                       exit
+                                       ;;
+                       esac
                        case " $HOSTS_THAT_ARE_MYSELF " in
                                *\ $host\ *)
                                        verbose rsync --delete -zLvaSHP "$srcdir"/ "$buildpath/"
@@ -1008,7 +1030,7 @@ case "$cmd" in
                                *)
                                        verbose rsync --delete -zLvaSHP "$srcdir"/ "$host:$buildpath/"
                                        verbose rsync --delete -zLvaSHP "$depsdir"/ "$host:$buildpath.deps/"
-                                       verbose ssh "$host" "ln -snf $buildpath.deps $buildpath/.deps && cd $buildpath && make clean $maketargets $makeflags"
+                                       verbose ssh "$host" "ln -snf $buildpath.deps $buildpath/.deps && cd $buildpath && nice -`nice` make clean $maketargets $makeflags"
                                        for f in $targetfiles; do
                                                verbose rsync -zvaSHP "$host:$buildpath/${f%:*}" "${f##*:}" || true
                                        done
@@ -1193,22 +1215,35 @@ case "$cmd" in
                        major=$(($gv / 10000))
                        minor=$(($gv / 100 - $major * 100))
                        patch=$(($gv - $major * 10000 - $minor * 100))
+                       versionstr="$major.$minor.$patch"
+                       case "$RELEASETYPE" in
+                               beta)
+                                       versionstr="$versionstr""beta"
+                                       ;;
+                       esac
                        verbose sed -i "
-                               s/^set g_xonoticversion [^ ]* /set g_xonoticversion $major.$minor.$patch /;
+                               s/^set g_xonoticversion [^ ]* /set g_xonoticversion $versionstr /;
                                s/^gameversion_min [0-9]*/gameversion_min $(( ($gv / 100) * 100 - 100 ))/;
                                s/^gameversion_max [0-9]*/gameversion_max $(( ($gv / 100) * 100 + 199 ))/;
                        " defaultXonotic.cfg
+                       (
+                               verbose cd gfx/menu/luminos
+                               verbose cp "$d0"/mediasource/gfx/menu/luminos_versionbuilder/background_l2.svg .
+                               verbose "$d0"/mediasource/gfx/menu/luminos_versionbuilder/versionbuilder "$versionstr"
+                               verbose rm background_l2.svg
+                       )
                fi
                if [ x"$src" = x"data/xonotic-maps.pk3dir" ]; then
                        for X in ../../data/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
                                if [ -f "$X" ]; then
                                        verbose unzip "$X"
+                                       verbose rm -f maps/*.log maps/*.irc maps/*.lin
                                fi
                        done
                fi
                verbose export git_src_repo="$d0/$src" # skip hash-object
                verbose "$SELF" release-buildpk3-transform-$transform "Xonotic/temp"
-               verbose zip -9yr "../../$dst" .
+               verbose mkzip "../../$dst" *
                verbose cd ../..
                verbose rm -rf Xonotic/temp
                ;;
@@ -1250,14 +1285,17 @@ case "$cmd" in
                ;;
        release-zip)
                stamp=`cat Xonotic/stamp.txt`
-               verbose zip -9yr Xonotic-$stamp-engine.zip \
+               # exe and dll files do not need +x, so this makes them eligible for 7zip compression too
+               chmod a-x Xonotic/*.exe Xonotic/*.dll || true
+               # need to use infozip for these (+x bits)
+               verbose mkzip Xonotic-$stamp-engine.zip \
                        Xonotic/*.dll \
                        Xonotic/bin64/*.dll \
                        Xonotic/*.app \
                        Xonotic/xonotic-* \
                        Xonotic/xonotic.exe
                verbose cp Xonotic-$stamp-engine.zip Xonotic-$stamp-common.zip
-               verbose zip -9yr Xonotic-$stamp-common.zip \
+               verbose mkzip Xonotic-$stamp-common.zip \
                        Xonotic/source/*/ \
                        Xonotic/Docs \
                        Xonotic/misc \
@@ -1266,23 +1304,23 @@ case "$cmd" in
                        Xonotic/key_0.d0pk \
                        Xonotic/data/font-nimbussansl-$stamp.pk3
                verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp.zip
-               verbose zip -0yr Xonotic-$stamp.zip \
+               verbose mkzip0 Xonotic-$stamp.zip \
                        Xonotic/data/xonotic-$stamp-data.pk3 \
                        Xonotic/data/xonotic-$stamp-maps.pk3 \
                        Xonotic/data/xonotic-$stamp-music.pk3 \
                        Xonotic/data/xonotic-$stamp-nexcompat.pk3
                verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-low.zip
-               verbose zip -0yr Xonotic-$stamp-low.zip \
+               verbose mkzip0 Xonotic-$stamp-low.zip \
                        Xonotic/data/xonotic-$stamp-data-low.pk3 \
                        Xonotic/data/xonotic-$stamp-maps-low.pk3 \
                        Xonotic/data/xonotic-$stamp-music-low.pk3
                verbose cp Xonotic-$stamp-common.zip Xonotic-$stamp-lowdds.zip
-               verbose zip -0yr Xonotic-$stamp-lowdds.zip \
+               verbose mkzip0 Xonotic-$stamp-lowdds.zip \
                        Xonotic/data/xonotic-$stamp-data-lowdds.pk3 \
                        Xonotic/data/xonotic-$stamp-maps-lowdds.pk3 \
                        Xonotic/data/xonotic-$stamp-music-low.pk3
                verbose mv Xonotic-$stamp-common.zip Xonotic-$stamp-high.zip
-               verbose zip -0yr Xonotic-$stamp-high.zip \
+               verbose mkzip0 Xonotic-$stamp-high.zip \
                        Xonotic/data/xonotic-$stamp-data-raw.pk3 \
                        Xonotic/data/xonotic-$stamp-maps-raw.pk3 \
                        Xonotic/data/xonotic-$stamp-music.pk3 \
index 0bd61fd..f6116a6 100755 (executable)
@@ -113,10 +113,10 @@ reduce_ogg_ogg()
 {
        i=$1; shift; shift
        o=$1; shift; shift
-       tags=`vorbiscomment -R -l "$i"`
+       tags=`vorbiscomment -R -l "$i" || true`
        oggdec -o "$tmpdir/x.wav" "$i" && \
        oggenc -q"$1" -o "$o" "$tmpdir/x.wav"
-       echo "$tags" | vorbiscomment -R -w "$o"
+       echo "$tags" | vorbiscomment -R -w "$o" || true
 }
 
 reduce_wav_ogg()
index 0fa7816..42a09bc 100755 (executable)
@@ -23,6 +23,20 @@ unrewrite()
        esac
 }
 
+ignorefile()
+{
+       case "$1" in
+               .gitattributes) return 0 ;;
+               scripts/nexcompat-trak4.shader) return 0 ;;
+               scripts/nexcompat-trak5.shader) return 0 ;;
+               scripts/nexcompat-eX.shader) return 0 ;;
+               textures/trak4/*) return 0 ;;
+               textures/trak5/*) return 0 ;;
+               textures/eX/*) return 0 ;;
+       esac
+       return 1
+}
+
 wantfile()
 {
        case "$1" in
@@ -85,9 +99,9 @@ cd "$COMPATLOC"
 git reset --hard
 git clean -xdf
 git ls-files | while IFS= read -r L; do
-       case "$L" in
-               .gitattributes) continue ;;
-       esac
+       if ignorefile "$L"; then
+               continue
+       fi
        if ! wantfile "`unrewrite "$L"`"; then
                echo "D $L"
                git rm -f "$L"
@@ -107,6 +121,9 @@ find "$NEXLOC" -type f | while IFS= read -r L; do
        L0=${L#$NEXLOC/}
        echo "$UP$L0$KILL" >&2
        LR=`rewrite "$L0"`
+       if ignorefile "$LR"; then
+               continue
+       fi
        if wantfile "$L0"; then
                newhash=`cd "$NEXLOC"; git rev-parse ":data/$L0"`
                if oldhash=`git rev-parse ":$LR" 2>/dev/null`; then
index 9e218f8..7f20818 100755 (executable)
@@ -3,11 +3,11 @@
 set -e
 
 bspdir="$PWD/data"
-url=http://141.2.16.23/~xonotic/bsp-autobuilds/
+url=http://beta.xonotic.org/autobuild-bsp/
+url_ssh=xonotic-beta:autobuild-bsp/
+cachedir="$HOME/xonotic-map-compiler.cache/"
 override="-bsp_timeout 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
 
-bspoutdir="$HOME/public_html/bsp-autobuilds/"
-
 allmaps()
 {
        for F in maps/*.map.options; do
@@ -116,10 +116,9 @@ buildthemap()
        REFNAME=$1
        HASH=$2
        url=$3
-       bspdir=$4
-       M=$5
-       blobhash=$6
-       if [ -f "$bspdir/$M-$blobhash.pk3" ]; then
+       M=$4
+       blobhash=$5
+       if HEAD "$url$M-$blobhash.pk3"; then
                continue
        fi
        if [ -n "$IRCSPAM" ]; then
@@ -136,8 +135,10 @@ buildthemap()
        if [ -n "$IRCSPAM" ]; then
                cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
        fi
-       zip -9r "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
-       ln -snf "../$M-$blobhash.pk3" "$bspdir/latest/$M.pk3" # from ALL branches, so beware!
+       zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
+       ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
+       rsync -vaSHP "$M-$blobhash.pk3" "$url_ssh"
+       rsync -vaSHP "$M.pk3" "$url_ssh""latest/"
        if [ -n "$IRCSPAM" ]; then
                $IRCSPAM < "maps/$M.irc"
        fi
@@ -169,14 +170,16 @@ getthemap()
 
 case "$1" in
        build)
-               mkdir -p "$bspoutdir"
-               mkdir -p "$bspoutdir/latest"
                cd data/xonotic-maps.pk3dir
                git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
+                       if [ -f "$cachedir/$HASH" ]; then
+                               continue
+                       fi
                        git reset --hard
                        git clean -xfd
                        git checkout -f "$HASH"
-                       allmaps buildthemap "$REFNAME" "$HASH" "$url" "$bspoutdir"
+                       allmaps buildthemap "$REFNAME" "$HASH" "$url"
+                       touch "$cachedir/$HASH"
                done
                git checkout -f master
                ;;
index 80b651a..45952cb 100755 (executable)
@@ -457,7 +457,7 @@ sub recvchallenge($)
                                        if not defined $s;
                                length $s
                                        or last;
-                               if($s =~ /^\377\377\377\377challenge (.*)$/s)
+                               if($s =~ /^\377\377\377\377challenge (.*?)(?:$|\0)/s)
                                {
                                        return $1;
                                }
index b5d3c89..88a98cc 100755 (executable)
@@ -514,7 +514,7 @@ sub recvchallenge($)
                                        if not defined $s;
                                length $s
                                        or last;
-                               if($s =~ /^\377\377\377\377challenge (.*)$/s)
+                               if($s =~ /^\377\377\377\377challenge (.*)(?:$|\0)/s)
                                {
                                        return $1;
                                }