summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-03-01 18:26:30 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-04-05 15:13:47 +0100
commiteff7238cf338c2a354ed9f8aaaf761b744570913 (patch)
treedf82686259e8a8cd638a731859ccb6acc0673a13 /meta
parent9ac4f5b88e592504e9edd8d3e65ad19c4113ee17 (diff)
downloadpoky-eff7238cf338c2a354ed9f8aaaf761b744570913.tar.gz
package-manager: add install_glob()
(From OE-Core rev: 8d1b530c82de386d4183f5673c060b9d416a3835) (From OE-Core rev: b9a7821086b5165fda9f1c8a7c79a7997803f2a6) (From OE-Core rev: c01a2c01a0c78a72ed715ac31a4578013ff44231) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> [Fixup for getVar True bit] Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/package_manager.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 8954338347..ad63fa31bf 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -563,6 +563,29 @@ class PackageManager(object, metaclass=ABCMeta):
563 pass 563 pass
564 564
565 """ 565 """
566 Install all packages that match a glob.
567 """
568 def install_glob(self, globs, sdk=False):
569 # TODO don't have sdk here but have a property on the superclass
570 # (and respect in install_complementary)
571 if sdk:
572 pkgdatadir = self.d.expand("${TMPDIR}/pkgdata/${SDK_SYS}")
573 else:
574 pkgdatadir = self.d.getVar("PKGDATA_DIR", True)
575
576 try:
577 bb.note("Installing globbed packages...")
578 cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs]
579 pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
580 self.install(pkgs.split(), attempt_only=True)
581 except subprocess.CalledProcessError as e:
582 # Return code 1 means no packages matched
583 if e.returncode != 1:
584 bb.fatal("Could not compute globbed packages list. Command "
585 "'%s' returned %d:\n%s" %
586 (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
587
588 """
566 Install complementary packages based upon the list of currently installed 589 Install complementary packages based upon the list of currently installed
567 packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install 590 packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install
568 these packages, if they don't exist then no error will occur. Note: every 591 these packages, if they don't exist then no error will occur. Note: every