diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-04-25 16:59:54 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-02 15:15:51 +0100 |
commit | 812dafbec1918fbbf89e8466988da602bf5edee0 (patch) | |
tree | 3db810e9589c288ac87b7abf501c44e1d9418d99 | |
parent | 8d79ca14786c9dcdaaaf3b592c481d36fd2767b5 (diff) | |
download | poky-812dafbec1918fbbf89e8466988da602bf5edee0.tar.gz |
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>
-rw-r--r-- | meta/classes-global/base.bbclass | 4 | ||||
-rw-r--r-- | meta/conf/bitbake.conf | 1 | ||||
-rw-r--r-- | meta/lib/oe/reproducible.py | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass index 0999b42daa..066f3848f7 100644 --- a/meta/classes-global/base.bbclass +++ b/meta/classes-global/base.bbclass | |||
@@ -153,7 +153,7 @@ python base_do_fetch() { | |||
153 | } | 153 | } |
154 | 154 | ||
155 | addtask unpack after do_fetch | 155 | addtask unpack after do_fetch |
156 | do_unpack[dirs] = "${WORKDIR}" | 156 | do_unpack[dirs] = "${UNPACKDIR}" |
157 | 157 | ||
158 | 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')}" | 158 | 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')}" |
159 | 159 | ||
@@ -164,7 +164,7 @@ python base_do_unpack() { | |||
164 | 164 | ||
165 | try: | 165 | try: |
166 | fetcher = bb.fetch2.Fetch(src_uri, d) | 166 | fetcher = bb.fetch2.Fetch(src_uri, d) |
167 | fetcher.unpack(d.getVar('WORKDIR')) | 167 | fetcher.unpack(d.getVar('UNPACKDIR')) |
168 | except bb.fetch2.BBFetchException as e: | 168 | except bb.fetch2.BBFetchException as e: |
169 | bb.fatal("Bitbake Fetcher Error: " + repr(e)) | 169 | bb.fatal("Bitbake Fetcher Error: " + repr(e)) |
170 | } | 170 | } |
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index ba8bd5f975..b2c500d873 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf | |||
@@ -405,6 +405,7 @@ STAMP = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}" | |||
405 | STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*" | 405 | STAMPCLEAN = "${STAMPS_DIR}/${MULTIMACH_TARGET_SYS}/${PN}/*-*" |
406 | BASE_WORKDIR ?= "${TMPDIR}/work" | 406 | BASE_WORKDIR ?= "${TMPDIR}/work" |
407 | WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}" | 407 | WORKDIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/${PV}" |
408 | UNPACKDIR ??= "${WORKDIR}" | ||
408 | T = "${WORKDIR}/temp" | 409 | T = "${WORKDIR}/temp" |
409 | D = "${WORKDIR}/image" | 410 | D = "${WORKDIR}/image" |
410 | S = "${WORKDIR}/${BP}" | 411 | S = "${WORKDIR}/${BP}" |
diff --git a/meta/lib/oe/reproducible.py b/meta/lib/oe/reproducible.py index 448befce33..a9f717159e 100644 --- a/meta/lib/oe/reproducible.py +++ b/meta/lib/oe/reproducible.py | |||
@@ -120,7 +120,7 @@ def get_source_date_epoch_from_git(d, sourcedir): | |||
120 | return int(p.stdout.decode('utf-8')) | 120 | return int(p.stdout.decode('utf-8')) |
121 | 121 | ||
122 | def get_source_date_epoch_from_youngest_file(d, sourcedir): | 122 | def get_source_date_epoch_from_youngest_file(d, sourcedir): |
123 | if sourcedir == d.getVar('WORKDIR'): | 123 | if sourcedir == d.getVar('UNPACKDIR'): |
124 | # These sources are almost certainly not from a tarball | 124 | # These sources are almost certainly not from a tarball |
125 | return None | 125 | return None |
126 | 126 | ||