mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
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.
This commit is contained in:
parent
cda8fa00f5
commit
24a9f3b816
1 changed files with 3 additions and 0 deletions
|
|
@ -305,6 +305,9 @@ def sha256_for_file(path):
|
||||||
|
|
||||||
for f, src, shasum in cachefiles:
|
for f, src, shasum in cachefiles:
|
||||||
relpath = os.path.join(cachedir, f)
|
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):
|
if not os.path.exists(relpath):
|
||||||
print "Downloading " + f + " to cache"
|
print "Downloading " + f + " to cache"
|
||||||
if subprocess.call(['wget', src, '-O', f], cwd=cachedir) != 0:
|
if subprocess.call(['wget', src, '-O', f], cwd=cachedir) != 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue