]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
base/bitbake.conf: Introduce UNPACKDIR
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 25 Apr 2024 15:59:54 +0000 (16:59 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 2 May 2024 14:15:26 +0000 (15:15 +0100)
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.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/base.bbclass
meta/conf/bitbake.conf
meta/lib/oe/reproducible.py

index 0999b42daaa8fba15ee34f6817b6fea9d3b8ec57..066f3848f7cbe9d0435bddaa4c265775377211ac 100644 (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))
 }
index ba8bd5f975f3dc6fba24807b117c1cf28d7b313a..b2c500d87396d6ba7a25cada2381ce0354ad1e71 100644 (file)
@@ -405,6 +405,7 @@ STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
 STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*"
 BASE_WORKDIR ?= "${TMPDIR}/work"
 WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}"
+UNPACKDIR ??= "${WORKDIR}"
 T = "${WORKDIR}/temp"
 D = "${WORKDIR}/image"
 S = "${WORKDIR}/${BP}"
index 448befce332f80c1b7fab98871a532970ab73f86..a9f717159e3d55291207290832b1b22b43035590 100644 (file)
@@ -120,7 +120,7 @@ def get_source_date_epoch_from_git(d, sourcedir):
     return int(p.stdout.decode('utf-8'))
 
 def get_source_date_epoch_from_youngest_file(d, sourcedir):
-    if sourcedir == d.getVar('WORKDIR'):
+    if sourcedir == d.getVar('UNPACKDIR'):
        # These sources are almost certainly not from a tarball
        return None