diff options
Diffstat (limited to 'meta/lib/oe/package_manager.py')
-rw-r--r-- | meta/lib/oe/package_manager.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py index d6a04089ba..a093c523d3 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -561,6 +561,29 @@ class PackageManager(object, metaclass=ABCMeta): | |||
561 | pass | 561 | pass |
562 | 562 | ||
563 | """ | 563 | """ |
564 | Install all packages that match a glob. | ||
565 | """ | ||
566 | def install_glob(self, globs, sdk=False): | ||
567 | # TODO don't have sdk here but have a property on the superclass | ||
568 | # (and respect in install_complementary) | ||
569 | if sdk: | ||
570 | pkgdatadir = self.d.expand("${TMPDIR}/pkgdata/${SDK_SYS}") | ||
571 | else: | ||
572 | pkgdatadir = self.d.getVar("PKGDATA_DIR") | ||
573 | |||
574 | try: | ||
575 | bb.note("Installing globbed packages...") | ||
576 | cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs] | ||
577 | pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") | ||
578 | self.install(pkgs.split(), attempt_only=True) | ||
579 | except subprocess.CalledProcessError as e: | ||
580 | # Return code 1 means no packages matched | ||
581 | if e.returncode != 1: | ||
582 | bb.fatal("Could not compute globbed packages list. Command " | ||
583 | "'%s' returned %d:\n%s" % | ||
584 | (' '.join(cmd), e.returncode, e.output.decode("utf-8"))) | ||
585 | |||
586 | """ | ||
564 | Install complementary packages based upon the list of currently installed | 587 | Install complementary packages based upon the list of currently installed |
565 | packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install | 588 | packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install |
566 | these packages, if they don't exist then no error will occur. Note: every | 589 | these packages, if they don't exist then no error will occur. Note: every |