aboutsummaryrefslogtreecommitdiffstats
path: root/MgaRepo
diff options
context:
space:
mode:
authorNicolas Vigier <boklm@mageia.org>2011-08-21 11:40:13 +0000
committerNicolas Vigier <boklm@mageia.org>2011-08-21 11:40:13 +0000
commit32562381d23f0d5522eaa4217d4f6d5450f05d15 (patch)
treee7823f92755a584eb5d3c06b83c4939e2e1e051a /MgaRepo
parentdcec24fcbf3f6d5895c722bd7d7dec7fc7375f39 (diff)
downloadmgarepo-32562381d23f0d5522eaa4217d4f6d5450f05d15.tar
mgarepo-32562381d23f0d5522eaa4217d4f6d5450f05d15.tar.gz
mgarepo-32562381d23f0d5522eaa4217d4f6d5450f05d15.tar.bz2
mgarepo-32562381d23f0d5522eaa4217d4f6d5450f05d15.tar.xz
mgarepo-32562381d23f0d5522eaa4217d4f6d5450f05d15.zip
check sha1sum of existing files
Diffstat (limited to 'MgaRepo')
-rw-r--r--MgaRepo/binrepo.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/MgaRepo/binrepo.py b/MgaRepo/binrepo.py
index 51a1940..1ad3549 100644
--- a/MgaRepo/binrepo.py
+++ b/MgaRepo/binrepo.py
@@ -57,7 +57,10 @@ def download_binary(topdir, sha1, filename):
url = mirror.normalize_path(url + "/" + sha1)
dest = os.path.join(topdir, 'SOURCES', filename)
if os.path.exists(dest):
- return 1
+ if file_hash(dest) == sha1:
+ return 1
+ else:
+ raise Error, "File with incorrect sha1sum: %s" % dest
context = {"dest": dest, "url": url}
try:
cmd = string.Template(fmt).substitute(context)