summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/__init__.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-04 10:30:54 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-02-10 23:37:01 +0000
commit04e260d5f2a79f8a8293a14006b38f2cffc4a27b (patch)
treeddd67f4b9f674d5354faf910cc6c7959fa25fe6e /lib/bb/fetch2/__init__.py
parentd0ffe023c4a642c8d1c188ec499870e7a7113d7d (diff)
downloadbitbake-04e260d5f2a79f8a8293a14006b38f2cffc4a27b.tar.gz
bitbake/fetch2: Drop old md5 handling code
Drop some old md5 functions since we have improved functionality now which includes sha256 checksum support. This stops each download being md5 checksumed twice. Also change ".md5" stamp extentions to ".done" to better describe its use as a download complete marker file and no longer write the md5 sum to the files. (From Poky rev: 74b71864fed79ce60e721945c8e239b3ebf49200) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/fetch2/__init__.py')
-rw-r--r--lib/bb/fetch2/__init__.py38
1 files changed, 8 insertions, 30 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 10c1e7355..bdec67776 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -357,17 +357,18 @@ def download(d, urls = None):
download_update(localpath, ud.localpath)
- if os.path.exists(ud.md5):
- # Touch the md5 file to show active use of the download
+ if os.path.exists(ud.donestamp):
+ # Touch the done stamp file to show active use of the download
try:
- os.utime(ud.md5, None)
+ os.utime(ud.donestamp, None)
except:
# Errors aren't fatal here
pass
else:
- # Only check the checksums if we've not seen this item before
+ # Only check the checksums if we've not seen this item before, then create the stamp
verify_checksum(u, ud, d)
- Fetch.write_md5sum(u, ud, d)
+ open(ud.donestamp, 'w').close()
+
bb.utils.unlockfile(lf)
@@ -636,7 +637,7 @@ class FetchData(object):
if self.localfile and self.localpath:
# Note: These files should always be in DL_DIR whereas localpath may not be.
basepath = bb.data.expand("${DL_DIR}/%s" % os.path.basename(self.localpath), d)
- self.md5 = basepath + '.md5'
+ self.donestamp = basepath + '.done'
self.lockfile = basepath + '.lock'
def setup_localpath(self, d):
@@ -779,7 +780,7 @@ class Fetch(object):
"""
if urldata.method.forcefetch(url, urldata, d):
return True
- elif os.path.exists(urldata.md5) and os.path.exists(urldata.localfile):
+ elif os.path.exists(urldata.donestamp) and os.path.exists(urldata.localfile):
return False
else:
return True
@@ -859,29 +860,6 @@ class Fetch(object):
localcount_internal_helper = staticmethod(localcount_internal_helper)
- def verify_md5sum(ud, got_sum):
- """
- Verify the md5sum we wanted with the one we got
- """
- wanted_sum = ud.parm.get('md5sum')
- if not wanted_sum:
- return True
-
- if wanted_sum != got_sum:
- raise MD5SumError(ud.localpath, wanted_sum, got_sum, ud.url)
-
- verify_md5sum = staticmethod(verify_md5sum)
-
- def write_md5sum(url, ud, d):
- md5data = bb.utils.md5_file(ud.localpath)
-
- Fetch.verify_md5sum(ud, md5data)
-
- md5out = file(ud.md5, 'w')
- md5out.write(md5data)
- md5out.close()
- write_md5sum = staticmethod(write_md5sum)
-
def latest_revision(self, url, ud, d, name):
"""
Look in the cache for the latest revision, if not present ask the SCM.