[OE-core] [PATCH 2/2] package_manager.py: Allow multiple regexps in PACKAGE_EXCLUDE_COMPLEMENTARY

Peter Kjellerstedt peter.kjellerstedt at axis.com
Wed Oct 5 15:14:20 UTC 2016


The PACKAGE_EXCLUDE_COMPLEMENTARY variable can currently only contain
one regular expression. This makes it hard to add to it from different
configuration files and recipes.

Allowing it to contain multiple, whitespace separated regular
expressions should be backwards compatible as it is assumed that
whitespace is not used in package names and thus is not used in any
existing instances of the variable.

After this change, the following three examples should be equivalent:

  PACKAGE_EXCLUDE_COMPLEMENTARY = "foo|bar"

  PACKAGE_EXCLUDE_COMPLEMENTARY = "foo bar"

  PACKAGE_EXCLUDE_COMPLEMENTARY = "foo"
  PACKAGE_EXCLUDE_COMPLEMENTARY += "bar"

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
---
 meta/lib/oe/package_manager.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 5f86aff..3cee973 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -598,7 +598,7 @@ class PackageManager(object, metaclass=ABCMeta):
                globs]
         exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY', True)
         if exclude:
-            cmd.extend(['--exclude=' + exclude])
+            cmd.extend(['--exclude=' + '|'.join(exclude.split())])
         try:
             bb.note("Installing complementary packages ...")
             bb.note('Running %s' % cmd)
-- 
2.9.0




More information about the Openembedded-core mailing list