From: Robert Yang <liezhi.yang@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 8/8] oe/copy_buildsystem.py: add SDK_LAYERS_EXCLUDE_PATTERN
Date: Wed, 16 Nov 2016 22:19:37 -0800 [thread overview]
Message-ID: <9003b14f4bb043c0eee17488ce40e4a72fbbcd56.1479363545.git.liezhi.yang@windriver.com> (raw)
In-Reply-To: <cover.1479363545.git.liezhi.yang@windriver.com>
It is helpful we want to exclude a lot of layers.
It uses python re, and supports multiple patterns (separated by space).
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
meta/lib/oe/copy_buildsystem.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/meta/lib/oe/copy_buildsystem.py b/meta/lib/oe/copy_buildsystem.py
index 29ac6d4..e5d00c7 100644
--- a/meta/lib/oe/copy_buildsystem.py
+++ b/meta/lib/oe/copy_buildsystem.py
@@ -1,5 +1,12 @@
# This class should provide easy access to the different aspects of the
# buildsystem such as layers, bitbake location, etc.
+#
+# SDK_LAYERS_EXCLUDE: Layers which will be excluded from SDK layers.
+# SDK_LAYERS_EXCLUDE_PATTERN: The simiar to SDK_LAYERS_EXCLUDE, this supports
+# python regular expression, use space as separator,
+# e.g.: ".*-downloads closed-.*"
+#
+
import stat
import shutil
@@ -23,8 +30,10 @@ class BuildSystem(object):
self.context = context
self.layerdirs = [os.path.abspath(pth) for pth in d.getVar('BBLAYERS', True).split()]
self.layers_exclude = (d.getVar('SDK_LAYERS_EXCLUDE', True) or "").split()
+ self.layers_exclude_pattern = d.getVar('SDK_LAYERS_EXCLUDE_PATTERN', True)
def copy_bitbake_and_layers(self, destdir, workspace_name=None):
+ import re
# Copy in all metadata layers + bitbake (as repositories)
layers_copied = []
bb.utils.mkdirhier(destdir)
@@ -36,8 +45,17 @@ class BuildSystem(object):
# Exclude layers
for layer_exclude in self.layers_exclude:
if layer_exclude in layers:
+ bb.note('Excluded %s from sdk layers since it is in SDK_LAYERS_EXCLUDE' % layer_exclude)
layers.remove(layer_exclude)
+ if self.layers_exclude_pattern:
+ layers_cp = layers[:]
+ for pattern in self.layers_exclude_pattern.split():
+ for layer in layers_cp:
+ if re.match(pattern, layer):
+ bb.note('Excluded %s from sdk layers since matched SDK_LAYERS_EXCLUDE_PATTERN' % layer)
+ layers.remove(layer)
+
workspace_newname = workspace_name
if workspace_newname:
layernames = [os.path.basename(layer) for layer in layers]
--
2.10.2
next prev parent reply other threads:[~2016-11-17 6:19 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-17 6:19 [PATCH 0/8] Fixes for eSDK and testsdkext Robert Yang
2016-11-17 6:19 ` [PATCH 1/8] populate_sdk_ext.bbclass: install multilib targets as populate_sdk does Robert Yang
2016-12-13 4:55 ` Paul Eggleton
2016-12-13 6:03 ` Robert Yang
2016-12-14 2:25 ` Robert Yang
2016-12-14 2:34 ` Paul Eggleton
2016-11-17 6:19 ` [PATCH 2/8] oeqa/sdkext/devtool.py: remove workspace/sources before running test cases Robert Yang
2016-12-13 4:45 ` Paul Eggleton
2016-12-13 5:56 ` Robert Yang
2016-12-13 6:29 ` Paul Eggleton
2016-12-13 6:47 ` Robert Yang
2016-12-13 8:21 ` Paul Eggleton
2016-12-13 8:31 ` Robert Yang
2016-12-13 13:58 ` Lopez, Mariano
2016-11-17 6:19 ` [PATCH 3/8] oe-publish-sdk: make cmd easier to read Robert Yang
2016-11-17 6:19 ` [PATCH 4/8] oe-publish-sdk: add pyshtables.py to .gitignore Robert Yang
2016-12-13 4:59 ` Paul Eggleton
2016-12-13 6:03 ` Robert Yang
2016-11-17 6:19 ` [PATCH 5/8] oeqa/sdkext/devtool.py: don't reset when the test is failed Robert Yang
2016-12-13 4:48 ` Paul Eggleton
2016-12-13 6:01 ` Robert Yang
2016-12-13 6:33 ` Paul Eggleton
2016-12-13 6:39 ` Robert Yang
2016-12-13 8:07 ` Paul Eggleton
2016-12-13 8:09 ` Robert Yang
2016-11-17 6:19 ` [PATCH 6/8] oeqa/oetest.py: add hasLockedSig() Robert Yang
2016-11-17 6:19 ` [PATCH 7/8] oeqa/sdkext/devtool.py: skip test_extend_autotools_recipe_creation when no libxml2 Robert Yang
2016-11-17 6:19 ` Robert Yang [this message]
[not found] ` <20161117065519.7693.7868@do.openembedded.org>
2016-11-17 9:02 ` ✗ patchtest: failure for Fixes for eSDK and testsdkext Burton, Ross
2016-11-17 17:12 ` Paul Eggleton
2016-11-29 7:38 ` Robert Yang
2016-11-29 9:10 ` Paul Eggleton
2016-12-13 2:58 ` [PATCH 0/8] " Robert Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9003b14f4bb043c0eee17488ce40e4a72fbbcd56.1479363545.git.liezhi.yang@windriver.com \
--to=liezhi.yang@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.