summaryrefslogtreecommitdiff
path: root/bitbake/lib
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-07 09:06:36 +0000
commit74b71864fed79ce60e721945c8e239b3ebf49200 (patch)
tree0b3b735bd9a774911658d0114cee0abdca337712 /bitbake/lib
parentd08397ba4d1331993300eacbb2f78fcfef19c1cf (diff)
downloadopenembedded-core-74b71864fed79ce60e721945c8e239b3ebf49200.tar.gz
openembedded-core-74b71864fed79ce60e721945c8e239b3ebf49200.tar.bz2
openembedded-core-74b71864fed79ce60e721945c8e239b3ebf49200.tar.xz
openembedded-core-74b71864fed79ce60e721945c8e239b3ebf49200.zip
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. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/fetch2/__init__.py38
1 files changed, 8 insertions, 30 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py
index 10c1e7355..bdec67776 100644
--- a/bitbake/lib/bb/fetch2/__init__.py
+++ b/bitbake/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.