[OE-core] [PATCH 2/2] base.bbclass: Restructure multilib variable cloning
Peter Seebach
peter.seebach at windriver.com
Fri Aug 10 22:58:00 UTC 2012
The checks for -native/-nativesdk packages, and the iteration over
multilibs, are shared between two (now three) blocks of code, and
nothing ever uses the bare multilib name (instead of the multilib
name plus a hyphen), so restructure this a bit. The checks for
-nativesdk/-native packages are now done before checking whether
something is a PREFERRED_* value, and the iteration over the lists
of preferred versions, preferred providers, and blacklists is done
inside a single iteration over multilibs. Out of sheer paranoia,
limit replacements to one.
---
meta/classes/base.bbclass | 58 ++++++++++++++++++++++----------------------
1 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 8677a30..dce7427 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -167,43 +167,43 @@ def preferred_ml_updates(d):
providers = []
blacklists = d.getVarFlags('PNBLACKLIST') or []
for v in d.keys():
+ if v.endswith("-native") or v.endswith("-nativesdk"):
+ continue
if v.startswith("PREFERRED_VERSION_"):
versions.append(v)
if v.startswith("PREFERRED_PROVIDER_"):
providers.append(v)
- for pkg, reason in blacklists.items():
- for p in prefixes:
- newpkg = p + "-" + pkg
+ for p in prefixes:
+ p = p + "-"
+ # Prepend <multilib>- to everything in PNBLACKLIST:
+ for pkg, reason in blacklists.items():
+ newpkg = p + pkg
if not d.getVarFlag('PNBLACKLIST', newpkg, True):
d.setVarFlag('PNBLACKLIST', newpkg, reason)
-
- for v in versions:
- val = d.getVar(v, False)
- pkg = v.replace("PREFERRED_VERSION_", "")
- if pkg.endswith("-native") or pkg.endswith("-nativesdk"):
- continue
- for p in prefixes:
- newname = "PREFERRED_VERSION_" + p + "-" + pkg
- if not d.getVar(newname, False):
- d.setVar(newname, val)
-
- for prov in providers:
- val = d.getVar(prov, False)
- pkg = prov.replace("PREFERRED_PROVIDER_", "")
- if pkg.endswith("-native") or pkg.endswith("-nativesdk"):
- continue
- virt = ""
- if pkg.startswith("virtual/"):
- pkg = pkg.replace("virtual/", "")
- virt = "virtual/"
- for p in prefixes:
- newname = "PREFERRED_PROVIDER_" + virt + p + "-" + pkg
+ # Prepend <multilib>- to all PREFERRED_VERSION_ values:
+ for v in versions:
+ val = d.getVar(v, False)
+ name = v.replace("PREFERRED_VERSION_", "PREFERRED_VERSION_" + p, 1)
+ if not d.getVar(name, False):
+ d.setVar(name, val)
+ # Trickier. We don't want lib32-virtual/foo, we want
+ # virtual/lib32-foo. Also, for recipes other than the
+ # kernel, we want to change the provider. So for instance,
+ # PREFERRED_PROVIDER_virtual/xyzzy = "plugh" yields
+ # PREFERRED_PROVIDER_virtual/lib32-xyzzy = "lib32-plugh"
+ for prov in providers:
+ val = d.getVar(prov, False)
+ pkg = prov.replace("PREFERRED_PROVIDER_", "", 1)
+ virt = ""
+ if pkg.startswith("virtual/"):
+ pkg = pkg.replace("virtual/", "", 1)
+ virt = "virtual/"
if pkg != "kernel":
- val = p + "-" + val
- if not d.getVar(newname, False):
- d.setVar(newname, val)
-
+ val = p + val
+ name = "PREFERRED_PROVIDER_" + virt + p + pkg
+ if not d.getVar(name, False):
+ d.setVar(name, val)
mp = (d.getVar("MULTI_PROVIDER_WHITELIST", True) or "").split()
extramp = []
--
1.7.0.4
More information about the Openembedded-core
mailing list