From fbc581a52e9b9993218e252fe7cac345d05dae5e Mon Sep 17 00:00:00 2001 From: ThomasV Date: Mon, 16 Mar 2015 12:17:41 +0100 Subject: [PATCH] update make_download script --- contrib/make_download | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/contrib/make_download b/contrib/make_download index c56aa5c2..0839ea80 100755 --- a/contrib/make_download +++ b/contrib/make_download @@ -28,13 +28,21 @@ for k, n in files.items(): link = "https://download.electrum.org/%s"%n if not os.path.exists(path): os.system("wget -q %s -O %s" % (link, path)) - if os.path.getsize(path): - md5 = hashlib.md5(file(path,'r').read()).digest().encode('hex') - string = string.replace("##link_%s##"%k, link) - string = string.replace("##md5_%s##"%k, md5) - else: + if not os.path.getsize(path): os.unlink(path) string = re.sub("
(.*?)
"%k, '', string, flags=re.DOTALL + re.MULTILINE) + continue + sigpath = path + '.asc' + siglink = link + '.asc' + if not os.path.exists(sigpath): + os.system("wget -q %s -O %s" % (siglink, sigpath)) + if not os.path.getsize(sigpath): + os.unlink(sigpath) + string = re.sub("
(.*?)
"%k, '', string, flags=re.DOTALL + re.MULTILINE) + continue + if os.system("gpg --verify %s"%sigpath) != 0: + raise + string = string.replace("##link_%s##"%k, link) with open(download_page,'w') as f: