summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2015-09-06 18:48:13 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-09 14:24:58 +0100
commit476f9ab6e37bd516919862835e6e00c960a9e242 (patch)
treedf853c5aaaf306d15100ec5328c4bd00668cba27
parent3479e299b5f11dfcd3f5f97c4ad3e0449f6c6d6a (diff)
downloadopenembedded-core-contrib-476f9ab6e37bd516919862835e6e00c960a9e242.tar.gz
openembedded-core-contrib-476f9ab6e37bd516919862835e6e00c960a9e242.tar.bz2
openembedded-core-contrib-476f9ab6e37bd516919862835e6e00c960a9e242.zip
package_manager.py: search provides when not found by pkgname
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@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/package_manager.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 810b728870..292ed44461 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 ""
'''