]> git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler-autobuild
another blobhash typo
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler-autobuild
index fbddd0d7a7ff0dc8c12e3e5a999d012fbdc01ede..d2f2ef4f7c4c4f27dc4731031eed3532448cdedc 100755 (executable)
@@ -36,16 +36,17 @@ buildthemap()
                ../../../misc/tools/xonotic-map-compiler "$M" -noshaderlist `head -n 1 "$M.map.options"` 2>&1 | tee "$M.log"
        )
        zip -9r "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
-       ln -snf "../$M-blobhash.pk3" "$bspdir/latest/$M.pk3" # from ALL branches, so beware!
+       ln -snf "../$M-$blobhash.pk3" "$bspdir/latest/$M.pk3" # from ALL branches, so beware!
 }
 
 getthemap()
 {
        url=$1
-       bspdir=$2
-       M=$3
-       blobhash=$4
-       if [ -f "$bspdir/$M-$blobhash.pk3" ]; then
+       bspdir_old=$2
+       bspdir=$3
+       M=$4
+       blobhash=$5
+       if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
                continue
        fi
        if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
@@ -74,8 +75,18 @@ case "$1" in
                git checkout master
                ;;
        download)
+               rm -rf "$bspdir.old"
+               mv "$bspdir" "$bspdir.old" || true
                mkdir -p "$bspdir"
                cd data/xonotic-maps.pk3dir
-               allmaps getthemap "$url" "$bspdir"
+               allmaps getthemap "$url" "$bspdir.old" "$bspdir"
+               echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
+               ls -l "$bspdir.old"
+               ;;
+       download-latest)
+               mkdir -p "$bspdir"
+               cd "$bspdir"
+               rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
+               wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url/latest"
                ;;
 esac