summaryrefslogtreecommitdiffstats
path: root/import-layers/yocto-poky/meta/lib/oe/package_manager.py
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-04-01 22:23:53 -0400
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-04-04 13:38:59 +0000
commit001113296d3300ffaf6b6d1578a4232dbf2695c8 (patch)
tree14ddda5f75227063a7dea14becfecda14e67c500 /import-layers/yocto-poky/meta/lib/oe/package_manager.py
parent211ccf33fb57ddede03d26cf7cb05924d039b2df (diff)
downloadtalos-openbmc-001113296d3300ffaf6b6d1578a4232dbf2695c8.tar.gz
talos-openbmc-001113296d3300ffaf6b6d1578a4232dbf2695c8.zip
Rocko refresh
poky: 0ec241873367e18f5371a3ad9aca1e2801dcd4ee meta-openembbeded: dacfa2b1920e285531bec55cd2f08743390aaf57 meta-virtualization: bd77388f31929f38e7d4cc9c711f0f83f563007e meta-raspberrypi: b58ccfc696e4fa6b680ae5ca79960312676d7af9 Tested: Built witherspoon, palmetto and qemu images Change-Id: I934ff48674042bb5ce6b7d75642e7adb9668a409 Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'import-layers/yocto-poky/meta/lib/oe/package_manager.py')
-rw-r--r--import-layers/yocto-poky/meta/lib/oe/package_manager.py31
1 files changed, 27 insertions, 4 deletions
diff --git a/import-layers/yocto-poky/meta/lib/oe/package_manager.py b/import-layers/yocto-poky/meta/lib/oe/package_manager.py
index 0c5d907ff..ed8fec850 100644
--- a/import-layers/yocto-poky/meta/lib/oe/package_manager.py
+++ b/import-layers/yocto-poky/meta/lib/oe/package_manager.py
@@ -371,6 +371,29 @@ class PackageManager(object, metaclass=ABCMeta):
pass
"""
+ Install all packages that match a glob.
+ """
+ def install_glob(self, globs, sdk=False):
+ # TODO don't have sdk here but have a property on the superclass
+ # (and respect in install_complementary)
+ if sdk:
+ pkgdatadir = self.d.expand("${TMPDIR}/pkgdata/${SDK_SYS}")
+ else:
+ pkgdatadir = self.d.getVar("PKGDATA_DIR")
+
+ try:
+ bb.note("Installing globbed packages...")
+ cmd = ["oe-pkgdata-util", "-p", pkgdatadir, "list-pkgs", globs]
+ pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
+ self.install(pkgs.split(), attempt_only=True)
+ except subprocess.CalledProcessError as e:
+ # Return code 1 means no packages matched
+ if e.returncode != 1:
+ bb.fatal("Could not compute globbed packages list. Command "
+ "'%s' returned %d:\n%s" %
+ (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
+
+ """
Install complementary packages based upon the list of currently installed
packages e.g. locales, *-dev, *-dbg, etc. This will only attempt to install
these packages, if they don't exist then no error will occur. Note: every
@@ -402,7 +425,7 @@ class PackageManager(object, metaclass=ABCMeta):
installed_pkgs.write(output)
installed_pkgs.flush()
- cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"),
+ cmd = ["oe-pkgdata-util",
"-p", self.d.getVar('PKGDATA_DIR'), "glob", installed_pkgs.name,
globs]
exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY')
@@ -412,11 +435,11 @@ class PackageManager(object, metaclass=ABCMeta):
bb.note("Installing complementary packages ...")
bb.note('Running %s' % cmd)
complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
+ self.install(complementary_pkgs.split(), attempt_only=True)
except subprocess.CalledProcessError as e:
bb.fatal("Could not compute complementary packages list. Command "
"'%s' returned %d:\n%s" %
(' '.join(cmd), e.returncode, e.output.decode("utf-8")))
- self.install(complementary_pkgs.split(), attempt_only=True)
def deploy_dir_lock(self):
if self.deploy_dir is None:
@@ -1066,7 +1089,7 @@ class OpkgPM(OpkgDpkgPM):
output = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT).decode("utf-8")
bb.note(output)
except subprocess.CalledProcessError as e:
- (bb.fatal, bb.note)[attempt_only]("Unable to install packages. "
+ (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
"Command '%s' returned %d:\n%s" %
(cmd, e.returncode, e.output.decode("utf-8")))
@@ -1365,7 +1388,7 @@ class DpkgPM(OpkgDpkgPM):
bb.note("Installing the following packages: %s" % ' '.join(pkgs))
subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
- (bb.fatal, bb.note)[attempt_only]("Unable to install packages. "
+ (bb.fatal, bb.warn)[attempt_only]("Unable to install packages. "
"Command '%s' returned %d:\n%s" %
(cmd, e.returncode, e.output.decode("utf-8")))
OpenPOWER on IntegriCloud