X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fxonotic.git;a=blobdiff_plain;f=misc%2Ftools%2Fxonotic-map-compiler-autobuild;h=00359af61b5a6bd66ff815ab30b120d3a6bc8cc6;hp=a22dceb4a98e3fb78401395253b6e8493752631a;hb=2cb95ff3d717286db24390056172f3f20a9c13f4;hpb=da509672ee02a2da100cf889a693a794e3ee14ed diff --git a/misc/tools/xonotic-map-compiler-autobuild b/misc/tools/xonotic-map-compiler-autobuild index a22dceb4..00359af6 100755 --- a/misc/tools/xonotic-map-compiler-autobuild +++ b/misc/tools/xonotic-map-compiler-autobuild @@ -42,10 +42,11 @@ buildthemap() 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