Re: Removing URL escapes from a Bitbake variable


Patrick Doyle <wpdster@...>
 

On Mon, Apr 6, 2020 at 3:34 PM Patrick Doyle <wpdster@...> wrote:

I have a recipe that looks something like this (I'm simplifying a bit here):

SRC_URI += "${EXTERNAL_URL}"

do_compile() {
do -something -with $(basename ${EXTERNAL_URL} .ext)
}

where EXTERNAL_URL is supplied in the environment when invoking
Bitbake (and is whitelisted in the environment).

The problem is, if that URL has HTTP escapes in it, they get decoded
by the fetcher, and the file in ${WORKDIR} no longer looks like
$(basename ${EXTERNAL_URL}).
Never mind. I found it. I did something like:

EXTERNAL_FILE="${@bb.fetch.decodeurl(d.getVar('EXTERNAL_URL',True))[2]}"
do_compile() {
do -something-with $(basename ${EXTERNAL_URL})
}

I would still be happy to learn of a better way to have done this.

--wpd

Join yocto@lists.yoctoproject.org to automatically receive all group messages.