From a958ec0586d79cfda4888d77b61febc5df5e7785 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt <stefan.schmidt@huawei.com> Date: Fri, 8 Oct 2021 15:49:09 +0200 Subject: [PATCH] ohos-sanity: Project rename We could add sanity checks for all newly deprecated collections and distros here. Signed-off-by: Stefan Schmidt <stefan.schmidt@huawei.com> --- ...os-sanity.bbclass => oniro-sanity.bbclass} | 30 +++++++++---------- .../conf/distro/include/allscenarios.inc | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) rename meta-ohos-core/classes/{ohos-sanity.bbclass => oniro-sanity.bbclass} (72%) diff --git a/meta-ohos-core/classes/ohos-sanity.bbclass b/meta-ohos-core/classes/oniro-sanity.bbclass similarity index 72% rename from meta-ohos-core/classes/ohos-sanity.bbclass rename to meta-ohos-core/classes/oniro-sanity.bbclass index e0e77938..64a6f383 100644 --- a/meta-ohos-core/classes/ohos-sanity.bbclass +++ b/meta-ohos-core/classes/oniro-sanity.bbclass @@ -3,16 +3,16 @@ # SPDX-License-Identifier: Apache-2.0 # Deprecated collections can be either completely removed or replaced by -# another layer. The format of OHOS_DEPRECATED_COLLECTIONS is a list of +# another layer. The format of ONIRO_DEPRECATED_COLLECTIONS is a list of # <DEPRECATED_COLLECTION>:<REPLACEMENT_COLLECTION>. When # <REPLACEMENT_COLLECTION> is not provided, the layer was removed without a # replacement. -OHOS_DEPRECATED_COLLECTIONS = " \ +ONIRO_DEPRECATED_COLLECTIONS = " \ meta-ohos-demo:meta-ohos-blueprints \ " -# Same format as for OHOS_DEPRECATED_COLLECTIONS but for DISTRO configurations. -OHOS_DEPRECATED_DISTROS = " \ +# Same format as for ONIRO_DEPRECATED_COLLECTIONS but for DISTRO configurations. +ONIRO_DEPRECATED_DISTROS = " \ allscenarios-linux-demo-dashboard:allscenarios-linux-blueprint-dashboard \ " @@ -20,8 +20,8 @@ def unpack_deprecation(elem) -> 'Tuple[str, str]': elem_split = elem.split(sep=':', maxsplit=1) return (elem_split[0], elem_split[1] if len(elem_split) == 2 else '') -def ohos_is_valid_config() -> bool: - """Handles AllScenariOS build configuration sanity checks.""" +def oniro_is_valid_config() -> bool: + """Handles Oniro Project build configuration sanity checks.""" # By default assume no fatal errors success = True @@ -29,7 +29,7 @@ def ohos_is_valid_config() -> bool: # # Layers deprecation # - for deprecation in d.getVar('OHOS_DEPRECATED_COLLECTIONS').split(): + for deprecation in d.getVar('ONIRO_DEPRECATED_COLLECTIONS').split(): (deprecated, new) = unpack_deprecation(deprecation) if deprecated in d.getVar('BBFILE_COLLECTIONS').split(): if new: @@ -51,7 +51,7 @@ def ohos_is_valid_config() -> bool: # # DISTRO deprecation # - for deprecation in d.getVar('OHOS_DEPRECATED_DISTROS').split(): + for deprecation in d.getVar('ONIRO_DEPRECATED_DISTROS').split(): (deprecated, new) = unpack_deprecation(deprecation) if deprecated == d.getVar('DISTRO'): if new: @@ -64,13 +64,13 @@ def ohos_is_valid_config() -> bool: return success -python ohos_sanity_handler() { - if d.getVar('OHOS_SANITY_SKIP', True) == "1": - bb.warn('AllScenariOS-specific sanity checks were skipped.') +python oniro_sanity_handler() { + if d.getVar('ONIRO_SANITY_SKIP', True) == "1": + bb.warn('Oniro-specific sanity checks were skipped.') return - if not ohos_is_valid_config(): - bb.fatal("AllScenariOS sanity checks included fatal errors. See above.") + if not oniro_is_valid_config(): + bb.fatal("Oniro Project sanity checks included fatal errors. See above.") } -addhandler ohos_sanity_handler -ohos_sanity_handler[eventmask] = "bb.event.BuildStarted" +addhandler oniro_sanity_handler +oniro_sanity_handler[eventmask] = "bb.event.BuildStarted" diff --git a/meta-ohos-core/conf/distro/include/allscenarios.inc b/meta-ohos-core/conf/distro/include/allscenarios.inc index 8e3a422b..2ee631af 100644 --- a/meta-ohos-core/conf/distro/include/allscenarios.inc +++ b/meta-ohos-core/conf/distro/include/allscenarios.inc @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 -INHERIT += "ohos-sanity" +INHERIT += "oniro-sanity" # With our layer setup we would add any bbappend found from our # layers.conf. This means blueprint-specific appends would leak -- GitLab