[oe] OEDEM 2009 summary: Death to checksums.ini?

Bernhard Reutner-Fischer rep.dot.nop at gmail.com
Thu Nov 12 19:18:09 UTC 2009


On Thu, Nov 12, 2009 at 06:36:02PM +0000, Phil Blundell wrote:
>On Wed, 2009-11-11 at 20:34 +0000, Phil Blundell wrote:

>diff --git a/classes/base.bbclass b/classes/base.bbclass
>index 9d063f2..9508754 100644
>--- a/classes/base.bbclass
>+++ b/classes/base.bbclass
>@@ -56,6 +56,50 @@ def base_chk_load_parser(config_paths):
> 
>     return parser
> 
>+def base_chk_file_vars(parser, localpath, params, data):
>+    try:
>+        name = params["name"]
>+    except KeyError:
>+        return False
>+    flagName = "%s.md5sum" % name
>+    want_md5sum = bb.data.getVarFlag("SRC_URI", flagName, data)
>+    flagName = "%s.sha256sum" % name
>+    want_sha256sum = bb.data.getVarFlag("SRC_URI", flagName, data)
>+
>+    if (want_sha256sum == None and want_md5sum == None):
>+        # no checksums to check, nothing to do
>+        return False
>+
>+    if not os.path.exists(localpath):
>+        localpath = base_path_out(localpath, data)
>+        bb.note("The localpath does not exist '%s'" % localpath)
>+        raise Exception("The path does not exist '%s'" % localpath)
>+
>+    if want_md5sum:
>+        try:
>+	    md5pipe = os.popen('PATH=%s md5sum %s' % (bb.data.getVar('PATH', data, True), localpath))
>+            md5data = (md5pipe.readline().split() or [ "" ])[0]
>+            md5pipe.close()
>+        except OSError, e:
>+            raise Exception("Executing md5sum failed")
>+        if want_md5sum != md5data:
>+            bb.note("The MD5Sums did not match. Wanted: '%s' and Got: '%s'" % (want_md5sum, md5data))

please s/and Got/and got/g

>+            raise Exception("MD5 Sums do not match. Wanted: '%s' Got: '%s'" % (want_md5sum, md5data))

Why are you providing the same information as a note and in the
exception text?
>+
>+    if want_sha256sum:
>+        try:
>+            shapipe = os.popen('PATH=%s oe_sha256sum %s' % (bb.data.getVar('PATH', data, True), localpath))
>+            shadata = (shapipe.readline().split() or [ "" ])[0]
>+            shapipe.close()
>+        except OSError, e:
>+            raise Exception("Executing shasum failed")

sha256sum
[]
>@@ -639,11 +683,11 @@ python base_do_fetch() {
> 	# Check each URI
> 	for url in src_uri.split():
> 		localpath = bb.data.expand(bb.fetch.localpath(url, localdata), localdata)
>-		(type,host,path,_,_,_) = bb.decodeurl(url)
>+		(type,host,path,_,_,params) = bb.decodeurl(url)
> 		uri = "%s://%s%s" % (type,host,path)
> 		try:
> 			if type == "http" or type == "https" or type == "ftp" or type == "ftps":

if type in ["http", "https", "ftp", "ftps"]:
(while you're at it :)

cheers,
Bernhard




More information about the Openembedded-devel mailing list