summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oe/package_manager.py3
-rw-r--r--meta/lib/oeqa/selftest/pkgdata.py5
-rwxr-xr-xscripts/oe-pkgdata-util6
3 files changed, 13 insertions, 1 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):
531 cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"), 531 cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
532 "-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file, 532 "-p", self.d.getVar('PKGDATA_DIR', True), "glob", installed_pkgs_file,
533 globs] 533 globs]
534 exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY', True)
535 if exclude:
536 cmd.extend(['-x', exclude])
534 try: 537 try:
535 bb.note("Installing complementary packages ...") 538 bb.note("Installing complementary packages ...")
536 complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT) 539 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):
207 # The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist) 207 # The following should not error (because when we use this during rootfs construction, sometimes the complementary package won't exist)
208 result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile) 208 result = runCmd('oe-pkgdata-util glob %s "*-nonexistent"' % pkglistfile)
209 self.assertEqual(result.output, '') 209 self.assertEqual(result.output, '')
210 # Test exclude option
211 result = runCmd('oe-pkgdata-util glob %s "*-dev *-dbg" -x "^libz"' % pkglistfile)
212 resultlist = result.output.split()
213 self.assertNotIn('libz-dev', resultlist)
214 self.assertNotIn('libz-dbg', resultlist)
210 215
211 def test_specify_pkgdatadir(self): 216 def test_specify_pkgdatadir(self):
212 result = runCmd('oe-pkgdata-util -p %s lookup-pkg glibc' % get_bb_var('PKGDATA_DIR')) 217 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 5a9f89b31b..b075775b8f 100755
--- a/scripts/oe-pkgdata-util
+++ b/scripts/oe-pkgdata-util
@@ -55,7 +55,10 @@ def glob(args):
55 logger.error('Unable to find package list file %s' % args.pkglistfile) 55 logger.error('Unable to find package list file %s' % args.pkglistfile)
56 sys.exit(1) 56 sys.exit(1)
57 57
58 skipregex = re.compile("-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-") 58 skipval = "-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-"
59 if args.exclude:
60 skipval += "|" + args.exclude
61 skipregex = re.compile(skipval)
59 62
60 mappedpkgs = set() 63 mappedpkgs = set()
61 with open(args.pkglistfile, 'r') as f: 64 with open(args.pkglistfile, 'r') as f:
@@ -466,6 +469,7 @@ def main():
466 description='Expands one or more glob expressions over the packages listed in pkglistfile') 469 description='Expands one or more glob expressions over the packages listed in pkglistfile')
467 parser_glob.add_argument('pkglistfile', help='File listing packages (one package name per line)') 470 parser_glob.add_argument('pkglistfile', help='File listing packages (one package name per line)')
468 parser_glob.add_argument('glob', nargs="+", help='Glob expression for package names, e.g. *-dev') 471 parser_glob.add_argument('glob', nargs="+", help='Glob expression for package names, e.g. *-dev')
472 parser_glob.add_argument('-x', '--exclude', help='Exclude packages matching specified regex from the glob operation')
469 parser_glob.set_defaults(func=glob) 473 parser_glob.set_defaults(func=glob)
470 474
471 475