diff options
Diffstat (limited to 'meta')
-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 7f9468728a..a907d6c7b9 100644 --- a/meta/lib/oe/package_manager.py +++ b/meta/lib/oe/package_manager.py | |||
@@ -370,6 +370,29 @@ class PackageManager(object, metaclass=ABCMeta): | |||
370 | pass | 370 | pass |
371 | 371 | ||
372 | """ | 372 | """ |
373 | Install all packages that match a glob. | ||
374 | """ | ||
375 | def install_glob(self, globs, sdk=False): | ||
376 | # TODO don't have sdk here but have a property on the superclass | ||
377 | # (and respect in install_complementary) | ||
378 | if sdk: | ||
379 | pkgdatadir = self.d.expand("${TMPDIR}/pkgdata/${SDK_SYS}") | ||
380 | else: | ||
381 | pkgdatadir = self.d.getVar("PKGDATA_DIR") | ||
382 | |||
383 | try: | ||
384 | bb.note("Installing globbed packages...") | ||
385 | cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs] | ||
386 | pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") | ||
387 | self.install(pkgs.split(), attempt_only=True) | ||
388 | except subprocess.CalledProcessError as e: | ||
389 | # Return code 1 means no packages matched | ||
390 | if e.returncode != 1: | ||
391 | bb.fatal("Could not compute globbed packages list. Command " | ||
392 | "'%s' returned %d:\n%s" % | ||
393 | (' '.join(cmd), e.returncode, e.output.decode("utf-8"))) | ||
394 | |||
395 | """ | ||
373 | Install complementary packages based upon the list of currently installed | 396 | Install complementary packages based upon the list of currently installed |
374 | packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install | 397 | packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install |
375 | these packages, if they don't exist then no error will occur. Note: every | 398 | these packages, if they don't exist then no error will occur. Note: every |