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-04 11:06:55 +0100
commit6922d0536faf45c6b37152b6f06a02313fb4eb5a (patch)
treea18857ca1b3cd14a7acc69c6f3eb936b8ca3cb6a /meta
parente70f9cd242e4470b741cc0e4d4c874ea61596609 (diff)
downloadpoky-6922d0536faf45c6b37152b6f06a02313fb4eb5a.tar.gz
package-manager: add install_glob()
(From OE-Core rev: 8d1b530c82de386d4183f5673c060b9d416a3835) (From OE-Core rev: 2d6d99fdc1644c2928a451cf866c40730b683173) 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.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 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