diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-02-18 10:23:42 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-03-03 14:34:10 +0000 |
commit | 6e9632e9798d78587c9317554c5547ab3b53837c (patch) | |
tree | d9966c3fb4c322c10025af6a3a8ad6cc0577b560 | |
parent | 59a85d3a95b54d4e099dbf5ad307893119ed58d9 (diff) | |
download | poky-6e9632e9798d78587c9317554c5547ab3b53837c.tar.gz |
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.
(From OE-Core master rev: d4fe8f639d87d5ff35e50d07d41d0c1e9f12c4e3)
(From OE-Core rev: e848484989307ae6826ba0f5217f7702322181e3)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oe/package_manager.py | 3 | ||||
-rwxr-xr-x | scripts/oe-pkgdata-util | 12 |
2 files changed, 12 insertions, 3 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index 8609156ca2..411b9d6309 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 | "glob", self.d.getVar('PKGDATA_DIR', True), installed_pkgs_file, | 532 | "glob", self.d.getVar('PKGDATA_DIR', True), 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/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index bf8754749e..28a9f8362b 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util | |||
@@ -28,7 +28,7 @@ import re | |||
28 | import optparse | 28 | import optparse |
29 | from collections import defaultdict | 29 | from collections import defaultdict |
30 | 30 | ||
31 | def glob(args, usage, debug=False): | 31 | def glob(args, usage, debug=False, exclude=""): |
32 | if len(args) < 3: | 32 | if len(args) < 3: |
33 | usage() | 33 | usage() |
34 | sys.exit(1) | 34 | sys.exit(1) |
@@ -45,7 +45,10 @@ def glob(args, usage, debug=False): | |||
45 | print('ERROR: Unable to find package list file %s' % pkglist_file) | 45 | print('ERROR: Unable to find package list file %s' % pkglist_file) |
46 | sys.exit(1) | 46 | sys.exit(1) |
47 | 47 | ||
48 | skipregex = re.compile("-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-") | 48 | skipval = "-locale-|^locale-base-|-dev$|-doc$|-dbg$|-staticdev$|^kernel-module-" |
49 | if exclude: | ||
50 | skipval += "|" + exclude | ||
51 | skipregex = re.compile(skipval) | ||
49 | 52 | ||
50 | mappedpkgs = set() | 53 | mappedpkgs = set() |
51 | with open(pkglist_file, 'r') as f: | 54 | with open(pkglist_file, 'r') as f: |
@@ -305,6 +308,9 @@ Available commands: | |||
305 | parser.add_option("-d", "--debug", | 308 | parser.add_option("-d", "--debug", |
306 | help = "Enable debug output", | 309 | help = "Enable debug output", |
307 | action="store_true", dest="debug", default=False) | 310 | action="store_true", dest="debug", default=False) |
311 | parser.add_option("-x", "--exclude", | ||
312 | help = "Exclude packages matching specified regex from the glob operation", | ||
313 | action="store", type="string", dest="exclude", default="") | ||
308 | 314 | ||
309 | options, args = parser.parse_args(sys.argv) | 315 | options, args = parser.parse_args(sys.argv) |
310 | args = args[1:] | 316 | args = args[1:] |
@@ -314,7 +320,7 @@ Available commands: | |||
314 | sys.exit(1) | 320 | sys.exit(1) |
315 | 321 | ||
316 | if args[0] == "glob": | 322 | if args[0] == "glob": |
317 | glob(args[1:], parser.print_help, options.debug) | 323 | glob(args[1:], parser.print_help, options.debug, options.exclude) |
318 | elif args[0] == "lookup-pkg": | 324 | elif args[0] == "lookup-pkg": |
319 | lookup_pkg(args[1:], parser.print_help, options.debug) | 325 | lookup_pkg(args[1:], parser.print_help, options.debug) |
320 | elif args[0] == "lookup-recipe": | 326 | elif args[0] == "lookup-recipe": |