All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Enable complementary package exclusion
@ 2015-02-16 17:57 Paul Eggleton
  2015-02-16 17:57 ` [PATCH 1/1] lib/oe/package_manager: support exclusion from complementary glob process by regex Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2015-02-16 17:57 UTC (permalink / raw)
  To: openembedded-core

The following change since commit d5af8539c0a1718a7254bcdcfa973e3c887dfbd6:

  syslinux: support ext2/3/4 device (2015-02-15 08:11:19 +0000)

is available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/exclude-complementary
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/exclude-complementary

Paul Eggleton (1):
  lib/oe/package_manager: support exclusion from complementary glob
    process by regex

 meta/lib/oe/package_manager.py    | 3 +++
 meta/lib/oeqa/selftest/pkgdata.py | 5 +++++
 scripts/oe-pkgdata-util           | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

-- 
1.9.3



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/1] lib/oe/package_manager: support exclusion from complementary glob process by regex
  2015-02-16 17:57 [PATCH 0/1] Enable complementary package exclusion Paul Eggleton
@ 2015-02-16 17:57 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2015-02-16 17:57 UTC (permalink / raw)
  To: openembedded-core

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>
---
 meta/lib/oe/package_manager.py    | 3 +++
 meta/lib/oeqa/selftest/pkgdata.py | 5 +++++
 scripts/oe-pkgdata-util           | 6 +++++-
 3 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index fcf05dc..986ae54 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 f689bf3..34eea46 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'))
diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util
index 5a9f89b..b075775 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -55,7 +55,10 @@ def glob(args):
         logger.error('Unable to find package list file %s' % args.pkglistfile)
         sys.exit(1)
 
-    skipregex = re.compile("-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-")
+    skipval = "-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-"
+    if args.exclude:
+        skipval += "|" + args.exclude
+    skipregex = re.compile(skipval)
 
     mappedpkgs = set()
     with open(args.pkglistfile, 'r') as f:
@@ -466,6 +469,7 @@ def main():
                                           description='Expands one or more glob expressions over the packages listed in pkglistfile')
     parser_glob.add_argument('pkglistfile', help='File listing packages (one package name per line)')
     parser_glob.add_argument('glob', nargs="+", help='Glob expression for package names, e.g. *-dev')
+    parser_glob.add_argument('-x', '--exclude', help='Exclude packages matching specified regex from the glob operation')
     parser_glob.set_defaults(func=glob)
 
 
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-16 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-16 17:57 [PATCH 0/1] Enable complementary package exclusion Paul Eggleton
2015-02-16 17:57 ` [PATCH 1/1] lib/oe/package_manager: support exclusion from complementary glob process by regex Paul Eggleton

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.