From 24a9f3b816ec8951bd43784e6bda98c2ea66984a Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 21 Jan 2016 15:41:26 +0100 Subject: [PATCH] makebuildserver: delete cached files with zero size If download fails to connect, it'll make a zero size file. Then the next run on ./makebuildserver will fail because the checksum will not be right. --- makebuildserver | 3 +++ 1 file changed, 3 insertions(+) diff --git a/makebuildserver b/makebuildserver index f745b0a3..4e575a09 100755 --- a/makebuildserver +++ b/makebuildserver @@ -305,6 +305,9 @@ def sha256_for_file(path): for f, src, shasum in cachefiles: relpath = os.path.join(cachedir, f) + # if download fails to connect, it'll make a zero size file + if os.path.exists(relpath) and os.stat(relpath).st_size == 0: + os.remove(relpath) if not os.path.exists(relpath): print "Downloading " + f + " to cache" if subprocess.call(['wget', src, '-O', f], cwd=cachedir) != 0: -- 2.30.2