Skip to content
Snippets Groups Projects
Verified Commit b997c8a4 authored by Andrei Gherzan's avatar Andrei Gherzan :penguin:
Browse files

ohos-sanity.bbclass: Add support for deprecated DISTRO configurations


The mechanism and value format of OHOS_DEPRECATED_DISTROS is identical
to OHOS_DEPRECATED_COLLECTIONS.

Deprecated distro configurations can be either completely removed or
replaced by another configuration. The format of OHOS_DEPRECATED_DISTROS
is a list of <DEPRECATED_DISTRO>:<REPLACEMENT_DISTRO>. When
<REPLACEMENT_DISTRO> is not provided, the distro was removed without a
replacement.

Signed-off-by: Andrei Gherzan's avatarAndrei Gherzan <andrei.gherzan@huawei.com>
parent b2e117ff
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,10 @@ OHOS_DEPRECATED_COLLECTIONS = " \ ...@@ -11,6 +11,10 @@ OHOS_DEPRECATED_COLLECTIONS = " \
meta-ohos-demo:meta-ohos-blueprints \ meta-ohos-demo:meta-ohos-blueprints \
" "
# Same format as for OHOS_DEPRECATED_COLLECTIONS but for DISTRO configurations.
OHOS_DEPRECATED_DISTROS = " \
"
def unpack_deprecation(elem) -> 'Tuple[str, str]': def unpack_deprecation(elem) -> 'Tuple[str, str]':
elem_split = elem.split(sep=':', maxsplit=1) elem_split = elem.split(sep=':', maxsplit=1)
return (elem_split[0], elem_split[1] if len(elem_split) == 2 else '') return (elem_split[0], elem_split[1] if len(elem_split) == 2 else '')
...@@ -42,7 +46,21 @@ def ohos_is_valid_config() -> bool: ...@@ -42,7 +46,21 @@ def ohos_is_valid_config() -> bool:
msg = "{0} is a deprecated layer. Adapt your bblayers.conf " \ msg = "{0} is a deprecated layer. Adapt your bblayers.conf " \
"accordingly.".format(deprecated) "accordingly.".format(deprecated)
bb.warn(msg) bb.warn(msg)
#
# DISTRO deprecation
#
for deprecation in d.getVar('OHOS_DEPRECATED_DISTROS').split():
(deprecated, new) = unpack_deprecation(deprecation)
if deprecated == d.getVar('DISTRO'):
if new:
msg = "{0} is a deprecated distro configuration. Use the {1} " \
"replacement.".format(deprecated, new)
else:
msg = "{0} is a deprecated distro configuration." \
.format(deprecated)
bb.warn(msg)
return success return success
python ohos_sanity_handler() { python ohos_sanity_handler() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment