From 4bc76adb97e6dc3f94eb539238bdf35c1ea6946e Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 14 Nov 2010 17:41:52 +0100 Subject: [PATCH] better handle interrupted download of a pk3 --- misc/tools/xonotic-map-compiler-autobuild | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/tools/xonotic-map-compiler-autobuild b/misc/tools/xonotic-map-compiler-autobuild index 384123fc..0fdcc501 100755 --- a/misc/tools/xonotic-map-compiler-autobuild +++ b/misc/tools/xonotic-map-compiler-autobuild @@ -260,9 +260,11 @@ getthemap() blobhash=$5 commithash=$6 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then - continue + if unzip -l "$bspdir/$M-$blobhash.pk3" >/dev/null 2>&1; then + return 0 + fi fi - if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then + if ! wget -c -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then rm -f "$bspdir/$M-$blobhash.pk3" echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet" -- 2.39.2