bitbake/lib/bb/fetch:
authorHolger Hans Peter Freyther <zecke@selfish.org>
Sat, 7 Jan 2006 17:42:23 +0000 (17:42 +0000)
committerHolger Hans Peter Freyther <zecke@selfish.org>
Sat, 7 Jan 2006 17:42:23 +0000 (17:42 +0000)
    -Make the wget fetcher use md5sum parameter associated
     with a URL.
    -In a bitbake file for use with OpenEmbedded
     SRC_URI="http://www.froglogic.de;md5sum=ABCDEF" will now
     work.

lib/bb/fetch/wget.py

index d9bbdd4..4a7d11b 100644 (file)
@@ -57,13 +57,13 @@ class Wget(Fetch):
     def go(self, d, urls = []):
         """Fetch urls"""
 
-        def md5_sum(basename, d):
+        def md5_sum(parm, d):
             """
-            Fast and incomplete OVERRIDE implementation for MD5SUM handling
-            MD5SUM_basename = "SUM" and fallback to MD5SUM_basename
+            Return the MD5SUM associated with the to be downloaded
+            file.
+            It can return None if no md5sum is associated
             """
-            var = "MD5SUM_%s" % basename
-            return data.getVar(var, d) or data.getVar("MD5SUM", d)
+            return parm['md5sum']
 
         def verify_md5sum(wanted_sum, got_sum):
             """
@@ -76,7 +76,7 @@ class Wget(Fetch):
 
         def fetch_uri(uri, basename, dl, md5, parm, d):
             # the MD5 sum we want to verify
-            wanted_md5sum = md5_sum(basename, d)
+            wanted_md5sum = md5_sum(parm, d)
             if os.path.exists(dl):
 #               file exists, but we didnt complete it.. trying again..
                 fetchcmd = data.getVar("RESUMECOMMAND", d, 1)