diff options
| -rw-r--r-- | meta/lib/oe/copy_buildsystem.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py index 4abec4666f..7cb784cf8c 100644 --- a/meta/lib/oe/copy_buildsystem.py +++ b/meta/lib/oe/copy_buildsystem.py | |||
| @@ -1,5 +1,12 @@ | |||
| 1 | # This class should provide easy access to the different aspects of the | 1 | # This class should provide easy access to the different aspects of the |
| 2 | # buildsystem such as layers, bitbake location, etc. | 2 | # buildsystem such as layers, bitbake location, etc. |
| 3 | # | ||
| 4 | # SDK_LAYERS_EXCLUDE: Layers which will be excluded from SDK layers. | ||
| 5 | # SDK_LAYERS_EXCLUDE_PATTERN: The simiar to SDK_LAYERS_EXCLUDE, this supports | ||
| 6 | # python regular expression, use space as separator, | ||
| 7 | # e.g.: ".*-downloads closed-.*" | ||
| 8 | # | ||
| 9 | |||
| 3 | import stat | 10 | import stat |
| 4 | import shutil | 11 | import shutil |
| 5 | 12 | ||
| @@ -23,8 +30,10 @@ class BuildSystem(object): | |||
| 23 | self.context = context | 30 | self.context = context |
| 24 | self.layerdirs = [os.path.abspath(pth) for pth in d.getVar('BBLAYERS').split()] | 31 | self.layerdirs = [os.path.abspath(pth) for pth in d.getVar('BBLAYERS').split()] |
| 25 | self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE') or "").split() | 32 | self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE') or "").split() |
| 33 | self.layers_exclude_pattern = d.getVar('SDK_LAYERS_EXCLUDE_PATTERN') | ||
| 26 | 34 | ||
| 27 | def copy_bitbake_and_layers(self, destdir, workspace_name=None): | 35 | def copy_bitbake_and_layers(self, destdir, workspace_name=None): |
| 36 | import re | ||
| 28 | # Copy in all metadata layers + bitbake (as repositories) | 37 | # Copy in all metadata layers + bitbake (as repositories) |
| 29 | copied_corebase = None | 38 | copied_corebase = None |
| 30 | layers_copied = [] | 39 | layers_copied = [] |
| @@ -41,8 +50,17 @@ class BuildSystem(object): | |||
| 41 | # Exclude layers | 50 | # Exclude layers |
| 42 | for layer_exclude in self.layers_exclude: | 51 | for layer_exclude in self.layers_exclude: |
| 43 | if layer_exclude in layers: | 52 | if layer_exclude in layers: |
| 53 | bb.note('Excluded %s from sdk layers since it is in SDK_LAYERS_EXCLUDE' % layer_exclude) | ||
| 44 | layers.remove(layer_exclude) | 54 | layers.remove(layer_exclude) |
| 45 | 55 | ||
| 56 | if self.layers_exclude_pattern: | ||
| 57 | layers_cp = layers[:] | ||
| 58 | for pattern in self.layers_exclude_pattern.split(): | ||
| 59 | for layer in layers_cp: | ||
| 60 | if re.match(pattern, layer): | ||
| 61 | bb.note('Excluded %s from sdk layers since matched SDK_LAYERS_EXCLUDE_PATTERN' % layer) | ||
| 62 | layers.remove(layer) | ||
| 63 | |||
| 46 | workspace_newname = workspace_name | 64 | workspace_newname = workspace_name |
| 47 | if workspace_newname: | 65 | if workspace_newname: |
| 48 | layernames = [os.path.basename(layer) for layer in layers] | 66 | layernames = [os.path.basename(layer) for layer in layers] |
