diff options
author | Ross Burton <ross.burton@intel.com> | 2018-03-01 18:26:30 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-04-02 17:06:24 +0100 |
commit | f768fb3d2245b349af44aaa81d39a667adb9778c (patch) | |
tree | d6d09ab71b35f9447d7ed92796f76036630b8a5e /meta | |
parent | 9248da456eb164ba90cfc8263655ef8afb8da9f9 (diff) | |
download | poky-f768fb3d2245b349af44aaa81d39a667adb9778c.tar.gz |
package-manager: add install_glob()
(From OE-Core rev: 8d1b530c82de386d4183f5673c060b9d416a3835)
(From OE-Core rev: b9a7821086b5165fda9f1c8a7c79a7997803f2a6)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 |