base/bitbake.conf: Introduce UNPACKDIR

Having the unpack directory hardcoded to WORKDIR makes it really hard to
make any changes to the unpack process to try and allow for cleanup for example.

As a first step toward unraveling the intertwined location usages, add a
variable, UNPACKDIR which is where the fetcher is asked to unpack fetched
sources. It defaults to the existing value of WORKDIR at this point.

(From OE-Core rev: e022d62ba917790af2121da57646271ef17c03fa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2024-04-25 16:59:54 +01:00
parent 8d79ca1478
commit 812dafbec1
3 changed files with 4 additions and 3 deletions

View File

@@ -153,7 +153,7 @@ python base_do_fetch() {
}
addtask unpack after do_fetch
do_unpack[dirs] = "${WORKDIR}"
do_unpack[dirs] = "${UNPACKDIR}"
do_unpack[cleandirs] = "${@d.getVar('S') if os.path.normpath(d.getVar('S')) != os.path.normpath(d.getVar('WORKDIR')) else os.path.join('${S}', 'patches')}"
@@ -164,7 +164,7 @@ python base_do_unpack() {
try:
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.unpack(d.getVar('WORKDIR'))
fetcher.unpack(d.getVar('UNPACKDIR'))
except bb.fetch2.BBFetchException as e:
bb.fatal("Bitbake Fetcher Error: " + repr(e))
}