[bitbake-devel] [PATCH] fetch2: Ensure cached url data is matched to a datastore

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Sun Dec 1 20:06:45 UTC 2019


Richard Purdie <richard.purdie at linuxfoundation.org> writes:

> There was a weird error in OE-Core where "devtool modify virtual/kernel"
> was showing basehash mismatch errors. This was due to SRCPV sometimes being:
> AUTOINC+b867b78b50_47b80ef7bd and sometimes
> AUTOINC+b867b78b50_255a750d28.

Hello,

unfortunately, this breaks one of my classes with parses SRC_URI.
E.g. a more or less minimal recipe like

-------
LICENSE = "CLOSED"

SRC_URI = "file://foo;name=bootsplash"

def _find_bootsplash(d):
    fetch = bb.fetch2.Fetch([], d)
    for url in fetch.urls:
        urldata = fetch.ud[url]
        parm = urldata.parm
        if parm.get('name') == 'bootsplash':
            return urldata

    raise Exception("no bootsplash")

def get_bootsplash_convert(d):
    uri = _find_bootsplash(d)

    if not uri.localpath:
        # happens in early parsing stage; skip further processing
        return None

    ## construct an image magick command to rotate/scale bootsplash
    ## ...

    return "true"

LOGO_CONVERT_CMD = "${@get_bootsplash_convert(d)}"

do_unpack[postfuncs] += "do_logo_preprocess do_unpack_logo"

do_logo_preprocess() {
    ${LOGO_CONVERT_CMD}
    false
}
------

fails with

| + None
| .../temp/run.do_logo_preprocess.29898: line 104: None: command not found

after this patch (seen in thud branch; not tested with other ones).
Before the patch, "true" (resp. "convert.im7") was called.

'uri.localpath' seems to be None in early build stages which is now
cached and used in places where it was (re)calculated previously.


Enrico
-- 
SIGMA Chemnitz GmbH       Registergericht:   Amtsgericht Chemnitz HRB 1750
Am Erlenwald 13           Geschaeftsfuehrer: Grit Freitag, Frank Pyritz
09128 Chemnitz


More information about the bitbake-devel mailing list