mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
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:
@@ -129,7 +129,7 @@ def checkout_layers(layers, layerdir, d):
|
|||||||
return layers_fixed_revisions
|
return layers_fixed_revisions
|
||||||
|
|
||||||
def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
|
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)
|
os.makedirs(build_conf_dir)
|
||||||
layers_s = []
|
layers_s = []
|
||||||
|
|
||||||
@@ -137,11 +137,11 @@ def setup_bitbake_build(bitbake_config, layerdir, setupdir, thisdir):
|
|||||||
l = os.path.join(layerdir, l)
|
l = os.path.join(layerdir, l)
|
||||||
layers_s.append(" {} \\".format(l))
|
layers_s.append(" {} \\".format(l))
|
||||||
|
|
||||||
for l in relative_layers:
|
for l in filerelative_layers:
|
||||||
if thisdir:
|
if thisdir:
|
||||||
l = os.path.join(thisdir, l)
|
l = os.path.join(thisdir, l)
|
||||||
else:
|
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 " \
|
"a layer path relative to itself. This can be done only " \
|
||||||
"when the configuration is specified by its path on local " \
|
"when the configuration is specified by its path on local " \
|
||||||
"disk, not when it's in a registry or is fetched over http.")
|
"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)
|
os.rename(bitbake_confdir, backup_bitbake_confdir)
|
||||||
|
|
||||||
if layers:
|
if layers:
|
||||||
relative_layers = bitbake_config.get("bb-layers-relative") or []
|
filerelative_layers = bitbake_config.get("bb-layers-file-relative") or []
|
||||||
_setup_build_conf(layers, relative_layers, bitbake_confdir)
|
_setup_build_conf(layers, filerelative_layers, bitbake_confdir)
|
||||||
|
|
||||||
if template:
|
if template:
|
||||||
bb.process.run("{} setup -c {} -b {} --no-shell".format(oesetupbuild, template, bitbake_builddir))
|
bb.process.run("{} setup -c {} -b {} --no-shell".format(oesetupbuild, template, bitbake_builddir))
|
||||||
|
|||||||
@@ -148,10 +148,10 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
"oe-fragments": ["test-fragment-2"]
|
"oe-fragments": ["test-fragment-2"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "gizmo-notemplate-with-relative-layers",
|
"name": "gizmo-notemplate-with-filerelative-layers",
|
||||||
"description": "Gizmo notemplate configuration using relative layers",
|
"description": "Gizmo notemplate configuration using filerelative layers",
|
||||||
"bb-layers": ["layerC","layerD/meta-layer"],
|
"bb-layers": ["layerC","layerD/meta-layer"],
|
||||||
"bb-layers-relative": ["layerE/meta-layer"],
|
"bb-layers-file-relative": ["layerE/meta-layer"],
|
||||||
"oe-fragments": ["test-fragment-2"]
|
"oe-fragments": ["test-fragment-2"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -206,12 +206,12 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
bblayers = f.read()
|
bblayers = f.read()
|
||||||
for l in bitbake_config["bb-layers"]:
|
for l in bitbake_config["bb-layers"]:
|
||||||
self.assertIn(os.path.join(setuppath, "layers", l), bblayers)
|
self.assertIn(os.path.join(setuppath, "layers", l), bblayers)
|
||||||
for l in bitbake_config.get("bb-layers-relative") or []:
|
for l in bitbake_config.get("bb-layers-file-relative") or []:
|
||||||
relative_layer = os.path.join(
|
filerelative_layer = os.path.join(
|
||||||
os.path.dirname(config_upstream["path"]),
|
os.path.dirname(config_upstream["path"]),
|
||||||
l,
|
l,
|
||||||
)
|
)
|
||||||
self.assertIn(relative_layer, bblayers)
|
self.assertIn(filerelative_layer, bblayers)
|
||||||
|
|
||||||
if 'oe-fragment' in bitbake_config.keys():
|
if 'oe-fragment' in bitbake_config.keys():
|
||||||
for f in bitbake_config["oe-fragments"]:
|
for f in bitbake_config["oe-fragments"]:
|
||||||
@@ -298,7 +298,7 @@ print("BBPATH is {{}}".format(os.environ["BBPATH"]))
|
|||||||
'gizmo-env-passthrough',
|
'gizmo-env-passthrough',
|
||||||
'gizmo-no-fragment',
|
'gizmo-no-fragment',
|
||||||
'gadget-notemplate','gizmo-notemplate',
|
'gadget-notemplate','gizmo-notemplate',
|
||||||
'gizmo-notemplate-with-relative-layers')}
|
'gizmo-notemplate-with-filerelative-layers')}
|
||||||
}
|
}
|
||||||
for cf, v in test_configurations.items():
|
for cf, v in test_configurations.items():
|
||||||
for c in v['buildconfigs']:
|
for c in v['buildconfigs']:
|
||||||
|
|||||||
Reference in New Issue
Block a user