[OE-core] [2/2] image.bbclass/rootfs.py: PREFERRED_PROVIDER for rdepends

Jate Sujjavanich jatedev at gmail.com
Thu May 7 23:50:47 UTC 2015


Add item (package name) to list that is searched for possible
PREFERRED_PROVIDER's.

The WARNING from bitbake suggested specifying a PREFERRED_PROVIDER for the
package name, but setting it did nothing because the filterRunTimeProviders
searched only for the recipe names.

For the example case in bug #6149, bitbake looks for
PREFERRED_PROVIDER_openssh
and PREFERRED_provider_dropbear. This change allows
PREFERRED_PROVIDER_sshd="dropbear".

Signed-off-by: Jate Sujjavanich <jatedev at gmail.com>
----
The following changes since commit efe5b0940a6abc7348d8c60c456d93f5de8dda89:

  providers.py: Add package name to PREFERRED_PROVIDER search (2015-05-07
19:07:18 -0400)

are available in the git repository at:

  git://github.com/jatedev/poky.git oe-core-image-rdepend-alt

for you to fetch changes up to 60e7c872713ec2bef97a8bd5090d72e5e713ef31:

  image.bbclass/rootfs.py: PREFERRED_PROVIDER for rdepends (2015-05-07
19:07:45 -0400)

----------------------------------------------------------------
Jate Sujjavanich (1):
      image.bbclass/rootfs.py: PREFERRED_PROVIDER for rdepends

 meta/classes/image.bbclass |   14 ++++++++++++++
 meta/lib/oe/rootfs.py      |    2 +-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 01f8b3f..9bcc369 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -283,6 +283,20 @@ python rootfs_process_ignore() {
 }
 do_rootfs[prefuncs] += "rootfs_process_ignore"

+python rootfs_process_preferred_providers() {
+    inst_pkgs = d.getVar("PACKAGE_INSTALL", True).split()
+    pref_pkgs = list()
+    for pkg in inst_pkgs:
+        prefervar = d.getVar("PREFERRED_PROVIDER_%s" % pkg, True)
+        if prefervar:
+            inst_pkgs.remove(pkg)
+            pref_pkgs.append(prefervar)
+            bb.note("Selecting %s to provide %s due to PREFERRED_PROVIDER"
% (prefervar, pkg))
+    inst_pkgs.extend(pref_pkgs)
+    d.setVar("PACKAGE_INSTALL", ' '.join(inst_pkgs))
+}
+do_rootfs[prefuncs] += "rootfs_process_preferred_providers"
+
 # We have to delay the runtime_mapping_rename until just before rootfs runs
 # otherwise, the multilib renaming could step in and squash any fixups that
 # may have occurred.
diff --git a/meta/lib/oe/rootfs.py b/meta/lib/oe/rootfs.py
index 6fb749f..64fa153 100644
--- a/meta/lib/oe/rootfs.py
+++ b/meta/lib/oe/rootfs.py
@@ -393,7 +393,7 @@ class RpmRootfs(Rootfs):
         pass

     def _log_check_error(self):
-        r = re.compile('(unpacking of archive failed|Cannot find
package|exit 1|ERR|Fail)')
+        r = re.compile('(unpacking of archive failed|Cannot find
package|exit 1|ERR(?!ED_PROVIDER)|Fail)')
         log_path = self.d.expand("${T}/log.do_rootfs")
         with open(log_path, 'r') as log:
             found_error = 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20150507/76597f55/attachment-0002.html>


More information about the Openembedded-core mailing list