[OE-core] [PATCH 1/1] package_manager.py: search provides when not found by pkgname
Robert Yang
liezhi.yang at windriver.com
Mon Sep 7 01:48:13 UTC 2015
Fixed when:
PACKAGE_CLASSES = "package_rpm"
IMAGE_INSTALL_append = " perl-module-warnings-register"
$ bitbake core-image-minimal
[snip]
ERROR: perl-module-warnings-register not found in the base feeds
[snip]
And it works well when PACKAGE_CLASSES = "package_ipk" since perl
provides perl-module-warnings-register, the "smart install
perl-module-warnings-register" also works well, this was because
_search_pkg_name_in_feeds() only searched pkg name, but no provides,
this patch fixes the problem.
Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
---
meta/lib/oe/package_manager.py | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 810b728..292ed44 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -760,6 +760,22 @@ class RpmPM(PackageManager):
# bb.note('%s -> %s' % (pkg, pkg + '@' + arch))
return pkg + '@' + arch
+ # Search provides if not found by pkgname.
+ bb.note('Not found %s by name, searching provides ...' % pkg)
+ cmd = "%s %s query --provides %s --show-format='$name-$version'" % \
+ (self.smart_cmd, self.smart_opt, pkg)
+ cmd += " | sed -ne 's/ *Provides://p'"
+ bb.note('cmd: %s' % cmd)
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=True)
+ # Found a provider
+ if output:
+ bb.note('Found providers for %s: %s' % (pkg, output))
+ for p in output.split():
+ for arch in feed_archs:
+ arch = arch.replace('-', '_')
+ if p.rstrip().endswith('@' + arch):
+ return p
+
return ""
'''
--
1.7.9.5
More information about the Openembedded-core
mailing list