summaryrefslogtreecommitdiffstats
path: root/meta/classes/base.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-09 11:23:30 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-06-11 10:30:56 +0100
commitba85bb605502a86fa83bd7a0f3d8ed644dc16a8c (patch)
treee30bf6f81aa714fad3b9f94c0814339410b0973f /meta/classes/base.bbclass
parent5ed5a3cc8a4d819a0af8ee59f0c960bc4de07b61 (diff)
downloadpoky-ba85bb605502a86fa83bd7a0f3d8ed644dc16a8c.tar.gz
classes/buildcfg: Move git/layer revision code into new OE module buildcfg
There is a load of duplicated git/layer/revision code which makes most sesne as a python library, not bbclass code. Start to refactor as such. (From OE-Core rev: 439cdf8a1e52fd2c4dc81dc40ce7e6af282ce7ac) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r--meta/classes/base.bbclass9
1 files changed, 5 insertions, 4 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index bdb3ac33c6..f59e95fef0 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -7,12 +7,11 @@ inherit staging
7inherit mirrors 7inherit mirrors
8inherit utils 8inherit utils
9inherit utility-tasks 9inherit utility-tasks
10inherit metadata_scm
11inherit logging 10inherit logging
12 11
13OE_EXTRA_IMPORTS ?= "" 12OE_EXTRA_IMPORTS ?= ""
14 13
15OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa oe.reproducible oe.rust ${OE_EXTRA_IMPORTS}" 14OE_IMPORTS += "os sys time oe.path oe.utils oe.types oe.package oe.packagegroup oe.sstatesig oe.lsb oe.cachedpath oe.license oe.qa oe.reproducible oe.rust oe.buildcfg ${OE_EXTRA_IMPORTS}"
16OE_IMPORTS[type] = "list" 15OE_IMPORTS[type] = "list"
17 16
18PACKAGECONFIG_CONFARGS ??= "" 17PACKAGECONFIG_CONFARGS ??= ""
@@ -35,6 +34,8 @@ def oe_import(d):
35# We need the oe module name space early (before INHERITs get added) 34# We need the oe module name space early (before INHERITs get added)
36OE_IMPORTED := "${@oe_import(d)}" 35OE_IMPORTED := "${@oe_import(d)}"
37 36
37inherit metadata_scm
38
38def lsb_distro_identifier(d): 39def lsb_distro_identifier(d):
39 adjust = d.getVar('LSB_DISTRO_ADJUST') 40 adjust = d.getVar('LSB_DISTRO_ADJUST')
40 adjust_func = None 41 adjust_func = None
@@ -219,8 +220,8 @@ def get_source_date_epoch_value(d):
219def get_layers_branch_rev(d): 220def get_layers_branch_rev(d):
220 layers = (d.getVar("BBLAYERS") or "").split() 221 layers = (d.getVar("BBLAYERS") or "").split()
221 layers_branch_rev = ["%-20s = \"%s:%s\"" % (os.path.basename(i), \ 222 layers_branch_rev = ["%-20s = \"%s:%s\"" % (os.path.basename(i), \
222 base_get_metadata_git_branch(i, None).strip(), \ 223 oe.buildcfg.get_metadata_git_branch(i, None).strip(), \
223 base_get_metadata_git_revision(i, None)) \ 224 oe.buildcfg.get_metadata_git_revision(i, None)) \
224 for i in layers] 225 for i in layers]
225 i = len(layers_branch_rev)-1 226 i = len(layers_branch_rev)-1
226 p1 = layers_branch_rev[i].find("=") 227 p1 = layers_branch_rev[i].find("=")