summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-02-16 17:57:03 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-17 14:19:37 +0000
commitd4fe8f639d87d5ff35e50d07d41d0c1e9f12c4e3 (patch)
tree7172274307bc0233f4c487b373cddf9dc49d142b /meta
parent8c9a25ae70d249b823ab2b0385d539eb8bbc1374 (diff)
downloadopenembedded-core-d4fe8f639d87d5ff35e50d07d41d0c1e9f12c4e3.tar.gz
openembedded-core-d4fe8f639d87d5ff35e50d07d41d0c1e9f12c4e3.tar.bz2
openembedded-core-d4fe8f639d87d5ff35e50d07d41d0c1e9f12c4e3.zip
lib/oe/package_manager: support exclusion from complementary glob process by regex
Sometimes you do not want certain packages to be installed when installing complementary packages, e.g. when using dev-pkgs in IMAGE_FEATURES you may not want to install all packages from a particular multilib. This introduces a new PACKAGE_EXCLUDE_COMPLEMENTARY variable to allow specifying regexes to match packages to exclude. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/package_manager.py3
-rw-r--r--meta/lib/oeqa/selftest/pkgdata.py5
2 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index fcf05dc282..986ae54942 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -531,6 +531,9 @@ class PackageManager(object):
cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
"-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
globs]
+ exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY', True)
+ if exclude:
+ cmd.extend(['-x', exclude])
try:
bb.note("Installing complementary packages ...")
complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
diff --git a/meta/lib/oeqa/selftest/pkgdata.py b/meta/lib/oeqa/selftest/pkgdata.py
index f689bf344e..34eea468e8 100644
--- a/meta/lib/oeqa/selftest/pkgdata.py
+++ b/meta/lib/oeqa/selftest/pkgdata.py
@@ -207,6 +207,11 @@ class OePkgdataUtilTests(oeSelfTest):
# The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist)
result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile)
self.assertEqual(result.output, '')
+ # Test exclude option
+ result = runCmd('oe-pkgdata-util glob %s "*-dev *-dbg" -x "^libz"' % pkglistfile)
+ resultlist = result.output.split()
+ self.assertNotIn('libz-dev', resultlist)
+ self.assertNotIn('libz-dbg', resultlist)
def test_specify_pkgdatadir(self):
result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR'))