[poky] [PATCH 1/1] FetchData: add SRC_URI checksum

Richard Purdie richard.purdie at linuxfoundation.org
Wed Dec 15 01:12:25 PST 2010


Hi Ke,

This patch looks good in general, just a couple of minor things:

On Tue, 2010-12-14 at 15:55 +0800, Yu Ke wrote:
>  
> +def verify_checksum(d, ud):
> +    """
> +    verify the MD5 and SHA256 checksum for downloaded src
> +    return True if matched, False if not
> +    """

This should be more explicit about the missing checksums case.

> +    md5data = bb.utils.md5_file(ud.localpath)
> +    sha256data = bb.utils.sha256_file(ud.localpath)
> +
> +    if (ud.md5_expected == None or ud.sha256_expected == None):
> +        bb.warn("Missing SRC_URI checksum for %s, consider to add\n" \
> +                "SRC_URI[%s] = \"%s\"\nSRC_URI[%s] = \"%s\"" \
> +                % (ud.localpath, ud.md5_name, md5data, ud.sha256_name, sha256data))
> +        # TODO: change to "return False" once all recpies has checksum entry
> +        return True

We can't just redefine "policy" like this in bitbake. I think missing
checksums will always be warnings and we might just make warnings
optionally fatal for bitbake.

What does this do for file:// urls or SCM urls?

Otherwise I'm good with the patch and if you tweak these things I'll
merge it.

Cheers,

Richard





More information about the poky mailing list