diff options
| -rw-r--r-- | scripts/lib/checklayer/__init__.py | 11 | ||||
| -rw-r--r-- | scripts/lib/checklayer/cases/bsp.py | 2 | ||||
| -rw-r--r-- | scripts/lib/checklayer/cases/common.py | 3 | ||||
| -rw-r--r-- | scripts/lib/checklayer/cases/distro.py | 2 | ||||
| -rwxr-xr-x | scripts/yocto-check-layer | 5 |
5 files changed, 15 insertions, 8 deletions
diff --git a/scripts/lib/checklayer/__init__.py b/scripts/lib/checklayer/__init__.py index 78c74ca6ec..0a0db2f02a 100644 --- a/scripts/lib/checklayer/__init__.py +++ b/scripts/lib/checklayer/__init__.py | |||
| @@ -16,6 +16,7 @@ class LayerType(Enum): | |||
| 16 | BSP = 0 | 16 | BSP = 0 |
| 17 | DISTRO = 1 | 17 | DISTRO = 1 |
| 18 | SOFTWARE = 2 | 18 | SOFTWARE = 2 |
| 19 | CORE = 3 | ||
| 19 | ERROR_NO_LAYER_CONF = 98 | 20 | ERROR_NO_LAYER_CONF = 98 |
| 20 | ERROR_BSP_DISTRO = 99 | 21 | ERROR_BSP_DISTRO = 99 |
| 21 | 22 | ||
| @@ -106,7 +107,13 @@ def _detect_layer(layer_path): | |||
| 106 | if distros: | 107 | if distros: |
| 107 | is_distro = True | 108 | is_distro = True |
| 108 | 109 | ||
| 109 | if is_bsp and is_distro: | 110 | layer['collections'] = _get_layer_collections(layer['path']) |
| 111 | |||
| 112 | if layer_name == "meta" and "core" in layer['collections']: | ||
| 113 | layer['type'] = LayerType.CORE | ||
| 114 | layer['conf']['machines'] = machines | ||
| 115 | layer['conf']['distros'] = distros | ||
| 116 | elif is_bsp and is_distro: | ||
| 110 | layer['type'] = LayerType.ERROR_BSP_DISTRO | 117 | layer['type'] = LayerType.ERROR_BSP_DISTRO |
| 111 | elif is_bsp: | 118 | elif is_bsp: |
| 112 | layer['type'] = LayerType.BSP | 119 | layer['type'] = LayerType.BSP |
| @@ -117,8 +124,6 @@ def _detect_layer(layer_path): | |||
| 117 | else: | 124 | else: |
| 118 | layer['type'] = LayerType.SOFTWARE | 125 | layer['type'] = LayerType.SOFTWARE |
| 119 | 126 | ||
| 120 | layer['collections'] = _get_layer_collections(layer['path']) | ||
| 121 | |||
| 122 | return layer | 127 | return layer |
| 123 | 128 | ||
| 124 | def detect_layers(layer_directories, no_auto): | 129 | def detect_layers(layer_directories, no_auto): |
diff --git a/scripts/lib/checklayer/cases/bsp.py b/scripts/lib/checklayer/cases/bsp.py index a80a5844da..b76163fb56 100644 --- a/scripts/lib/checklayer/cases/bsp.py +++ b/scripts/lib/checklayer/cases/bsp.py | |||
| @@ -11,7 +11,7 @@ from checklayer.case import OECheckLayerTestCase | |||
| 11 | class BSPCheckLayer(OECheckLayerTestCase): | 11 | class BSPCheckLayer(OECheckLayerTestCase): |
| 12 | @classmethod | 12 | @classmethod |
| 13 | def setUpClass(self): | 13 | def setUpClass(self): |
| 14 | if self.tc.layer['type'] != LayerType.BSP: | 14 | if self.tc.layer['type'] not in (LayerType.BSP, LayerType.CORE): |
| 15 | raise unittest.SkipTest("BSPCheckLayer: Layer %s isn't BSP one." %\ | 15 | raise unittest.SkipTest("BSPCheckLayer: Layer %s isn't BSP one." %\ |
| 16 | self.tc.layer['name']) | 16 | self.tc.layer['name']) |
| 17 | 17 | ||
diff --git a/scripts/lib/checklayer/cases/common.py b/scripts/lib/checklayer/cases/common.py index 491a13953c..722d3cf638 100644 --- a/scripts/lib/checklayer/cases/common.py +++ b/scripts/lib/checklayer/cases/common.py | |||
| @@ -12,6 +12,9 @@ from checklayer.case import OECheckLayerTestCase | |||
| 12 | 12 | ||
| 13 | class CommonCheckLayer(OECheckLayerTestCase): | 13 | class CommonCheckLayer(OECheckLayerTestCase): |
| 14 | def test_readme(self): | 14 | def test_readme(self): |
| 15 | if self.tc.layer['type'] == LayerType.CORE: | ||
| 16 | raise unittest.SkipTest("Core layer's README is top level") | ||
| 17 | |||
| 15 | # The top-level README file may have a suffix (like README.rst or README.txt). | 18 | # The top-level README file may have a suffix (like README.rst or README.txt). |
| 16 | readme_files = glob.glob(os.path.join(self.tc.layer['path'], '[Rr][Ee][Aa][Dd][Mm][Ee]*')) | 19 | readme_files = glob.glob(os.path.join(self.tc.layer['path'], '[Rr][Ee][Aa][Dd][Mm][Ee]*')) |
| 17 | self.assertTrue(len(readme_files) > 0, | 20 | self.assertTrue(len(readme_files) > 0, |
diff --git a/scripts/lib/checklayer/cases/distro.py b/scripts/lib/checklayer/cases/distro.py index f0bee5493c..a35332451c 100644 --- a/scripts/lib/checklayer/cases/distro.py +++ b/scripts/lib/checklayer/cases/distro.py | |||
| @@ -11,7 +11,7 @@ from checklayer.case import OECheckLayerTestCase | |||
| 11 | class DistroCheckLayer(OECheckLayerTestCase): | 11 | class DistroCheckLayer(OECheckLayerTestCase): |
| 12 | @classmethod | 12 | @classmethod |
| 13 | def setUpClass(self): | 13 | def setUpClass(self): |
| 14 | if self.tc.layer['type'] != LayerType.DISTRO: | 14 | if self.tc.layer['type'] not in (LayerType.DISTRO, LayerType.CORE): |
| 15 | raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\ | 15 | raise unittest.SkipTest("DistroCheckLayer: Layer %s isn't Distro one." %\ |
| 16 | self.tc.layer['name']) | 16 | self.tc.layer['name']) |
| 17 | 17 | ||
diff --git a/scripts/yocto-check-layer b/scripts/yocto-check-layer index 0e5b75b1f7..67cc71950f 100755 --- a/scripts/yocto-check-layer +++ b/scripts/yocto-check-layer | |||
| @@ -168,14 +168,13 @@ def main(): | |||
| 168 | 168 | ||
| 169 | layers_tested = 0 | 169 | layers_tested = 0 |
| 170 | for layer in layers: | 170 | for layer in layers: |
| 171 | if layer['type'] == LayerType.ERROR_NO_LAYER_CONF or \ | 171 | if layer['type'] in (LayerType.ERROR_NO_LAYER_CONF, LayerType.ERROR_BSP_DISTRO): |
| 172 | layer['type'] == LayerType.ERROR_BSP_DISTRO: | ||
| 173 | continue | 172 | continue |
| 174 | 173 | ||
| 175 | # Reset to a clean backup copy for each run | 174 | # Reset to a clean backup copy for each run |
| 176 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) | 175 | shutil.copyfile(bblayersconf + '.backup', bblayersconf) |
| 177 | 176 | ||
| 178 | if check_bblayers(bblayersconf, layer['path'], logger): | 177 | if layer['type'] not in (LayerType.CORE, ) and check_bblayers(bblayersconf, layer['path'], logger): |
| 179 | logger.info("%s already in %s. To capture initial signatures, layer under test should not present " | 178 | logger.info("%s already in %s. To capture initial signatures, layer under test should not present " |
| 180 | "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name'])) | 179 | "in BBLAYERS. Please remove %s from BBLAYERS." % (layer['name'], bblayersconf, layer['name'])) |
| 181 | results[layer['name']] = None | 180 | results[layer['name']] = None |
