Files
meta-st-openstlinux/classes/check-st-openstlinux-compatibility.bbclass
Christophe Priouzeau cc16db210e CONF: update OpenSTLinux compatibility version
Signed-off-by: Christophe Priouzeau <christophe.priouzeau@foss.st.com>
Change-Id: I1fd9086cd0c108f17514c643d4bb4e7367e23b31
2021-11-17 09:24:07 +01:00

25 lines
1.1 KiB
Plaintext

# The goal of this class are to check if the layers are compatible with OpenSTLinux version.
# The verification are based on ST_OSTL_COMPATIBILTY_VERSION variable defined on layer.conf
def check_sanity_ostl(sanity_data):
ref_layer = "st-openstlinux"
ref_version = d.getVar("ST_OSTL_COMPATIBILITY_VERSION_%s" % ref_layer, None)
#bb.warn("OSTL: reference version: %s" % ref_version)
layerlist = set((d.getVar("BBFILE_COLLECTIONS") or "").split())
for layername in layerlist:
versions = d.getVar("ST_OSTL_COMPATIBILITY_VERSION_%s" % layername)
if versions is None:
versions = d.getVar("ST_OSTL_COMPATIBILTY_VERSION_%s" % layername)
if versions is not None:
if not ref_version in versions:
raise_sanity_error("OSTL: layer %s (ver = %s) are not compatible with OpenSTlinux (Version = %s)" % (layername, versions, ref_version), sanity_data)
os._exit(1)
addhandler check_sanity_ostl_version_eventhandler
check_sanity_ostl_version_eventhandler[eventmask] = "bb.event.SanityCheck"
python check_sanity_ostl_version_eventhandler() {
check_sanity_ostl(e.data)
}