summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-03-01 18:26:29 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-01 22:18:47 +0000
commitb194e2f15fff3466d6dead90786c09aa749db04a (patch)
tree5da473ee63132a52ac380ef892e7de4a8bf044cb
parent307c07fb8da34e1296eb7f86eeed79536e84fcc0 (diff)
downloadpoky-b194e2f15fff3466d6dead90786c09aa749db04a.tar.gz
package_manager: improve install_complementary
- No need to use bb.utils.which() as subprocess will search $PATH - Clarity flow by moving the install inside the try/except (From OE-Core rev: f4d22b7195dd8f08fe26dd353c7e860208e87d6a) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/package_manager.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 8c567be0f4..d1336d33ac 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -402,7 +402,7 @@ class PackageManager(object, metaclass=ABCMeta):
402 installed_pkgs.write(output) 402 installed_pkgs.write(output)
403 installed_pkgs.flush() 403 installed_pkgs.flush()
404 404
405 cmd = [bb.utils.which(os.getenv('PATH'), "oe-pkgdata-util"), 405 cmd = ["oe-pkgdata-util",
406 "-p", self.d.getVar('PKGDATA_DIR'), "glob", installed_pkgs.name, 406 "-p", self.d.getVar('PKGDATA_DIR'), "glob", installed_pkgs.name,
407 globs] 407 globs]
408 exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY') 408 exclude = self.d.getVar('PACKAGE_EXCLUDE_COMPLEMENTARY')
@@ -412,11 +412,11 @@ class PackageManager(object, metaclass=ABCMeta):
412 bb.note("Installing complementary packages ...") 412 bb.note("Installing complementary packages ...")
413 bb.note('Running %s' % cmd) 413 bb.note('Running %s' % cmd)
414 complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8") 414 complementary_pkgs = subprocess.check_output(cmd, stderr=subprocess.STDOUT).decode("utf-8")
415 self.install(complementary_pkgs.split(), attempt_only=True)
415 except subprocess.CalledProcessError as e: 416 except subprocess.CalledProcessError as e:
416 bb.fatal("Could not compute complementary packages list. Command " 417 bb.fatal("Could not compute complementary packages list. Command "
417 "'%s' returned %d:\n%s" % 418 "'%s' returned %d:\n%s" %
418 (' '.join(cmd), e.returncode, e.output.decode("utf-8"))) 419 (' '.join(cmd), e.returncode, e.output.decode("utf-8")))
419 self.install(complementary_pkgs.split(), attempt_only=True)
420 420
421 def deploy_dir_lock(self): 421 def deploy_dir_lock(self):
422 if self.deploy_dir is None: 422 if self.deploy_dir is None: