bitbake: bitbake-setup: Rename bb-layers-relative to bb-layers-file-relative

The difference between bb-layers and bb-layers-relative is unclear as both
are relative paths. Rename one to "file-relative" which makes it clear it
is relative to the current file, without becomming a long name.

https://lists.openembedded.org/g/bitbake-devel/message/18296

Based on a patch from Alexander Kanavin <alex@linutronix.de> but
with different naming.

(Bitbake rev: dcb17758b99767ab6da4172cf60eabc9269082dd)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2025-11-07 09:00:25 +01:00
parent 516039e609
commit 2aeb91cdb3
2 changed files with 12 additions and 12 deletions

View File

@ -129,7 +129,7 @@ def checkout_layers(layers, layerdir, d):
return layers_fixed_revisions
def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
def _setup_build_conf(layers, relative_layers, build_conf_dir):
def _setup_build_conf(layers, filerelative_layers, build_conf_dir):
os.makedirs(build_conf_dir)
layers_s = []
@ -137,11 +137,11 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
l = os.path.join(layerdir, l)
layers_s.append(" {} \\".format(l))
for l in relative_layers:
for l in filerelative_layers:
if thisdir:
l = os.path.join(thisdir, l)
else:
raise Exception("Configuration is using bb-layers-relative to specify " \
raise Exception("Configuration is using bb-layers-file-relative to specify " \
"a layer path relative to itself. This can be done only " \
"when the configuration is specified by its path on local " \
"disk, not when it's in a registry or is fetched over http.")
@ -223,8 +223,8 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
os.rename(bitbake_confdir, backup_bitbake_confdir)
if layers:
relative_layers = bitbake_config.get("bb-layers-relative") or []
_setup_build_conf(layers, relative_layers, bitbake_confdir)
filerelative_layers = bitbake_config.get("bb-layers-file-relative") or []
_setup_build_conf(layers, filerelative_layers, bitbake_confdir)
if template:
bb.process.run("{} setup -c {} -b {} --no-shell".format(oesetupbuild, template, bitbake_builddir))

View File

@ -148,10 +148,10 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
"oe-fragments": ["test-fragment-2"]
},
{
"name": "gizmo-notemplate-with-relative-layers",
"description": "Gizmo notemplate configuration using relative layers",
"name": "gizmo-notemplate-with-filerelative-layers",
"description": "Gizmo notemplate configuration using filerelative layers",
"bb-layers": ["layerC","layerD/meta-layer"],
"bb-layers-relative": ["layerE/meta-layer"],
"bb-layers-file-relative": ["layerE/meta-layer"],
"oe-fragments": ["test-fragment-2"]
}
]
@ -206,12 +206,12 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
bblayers = f.read()
for l in bitbake_config["bb-layers"]:
self.assertIn(os.path.join(setuppath, "layers", l), bblayers)
for l in bitbake_config.get("bb-layers-relative") or []:
relative_layer = os.path.join(
for l in bitbake_config.get("bb-layers-file-relative") or []:
filerelative_layer = os.path.join(
os.path.dirname(config_upstream["path"]),
l,
)
self.assertIn(relative_layer, bblayers)
self.assertIn(filerelative_layer, bblayers)
if 'oe-fragment' in bitbake_config.keys():
for f in bitbake_config["oe-fragments"]:
@ -298,7 +298,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
'gizmo-env-passthrough',
'gizmo-no-fragment',
'gadget-notemplate','gizmo-notemplate',
'gizmo-notemplate-with-relative-layers')}
'gizmo-notemplate-with-filerelative-layers')}
}
for cf, v in test_configurations.items():
for c in v['buildconfigs']: