* [PATCH 1/2] base.bbclass: Expand PNBLACKLIST across multilibs too
2012-08-10 22:57 [PATCH 0/2] Make PNBLACKLIST work with multilibs, code cleanup Peter Seebach
@ 2012-08-10 22:57 ` Peter Seebach
2012-08-10 23:13 ` Peter Seebach
2012-08-10 22:58 ` [PATCH 2/2] base.bbclass: Restructure multilib variable cloning Peter Seebach
2012-08-16 18:31 ` [PATCH 0/2] Make PNBLACKLIST work with multilibs, code cleanup Saul Wold
2 siblings, 1 reply; 5+ messages in thread
From: Peter Seebach @ 2012-08-10 22:57 UTC (permalink / raw)
To: openembedded-core
The PNBLACKLIST feature does not currently work with multilibs,
because they have different ${PN}. The obvious thing to do is to
do this at the same point that we do the PREFERRED_PROVIDER
and PREFERRED_VERSION fixups. (Making the PNBLACKLIST check
do the for-each-multilib check requires it to do the multilib
list generation repeatedly.)
---
meta/classes/base.bbclass | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index e15fa26..8677a30 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -151,7 +151,8 @@ def pkgarch_mapping(d):
def preferred_ml_updates(d):
# If any PREFERRED_PROVIDER or PREFERRED_VERSIONS are set,
- # we need to mirror these variables in the multilib case
+ # we need to mirror these variables in the multilib case;
+ # likewise the PNBLACKLIST flags.
multilibs = d.getVar('MULTILIBS', True) or ""
if not multilibs:
return
@@ -164,12 +165,19 @@ def preferred_ml_updates(d):
versions = []
providers = []
+ blacklists = d.getVarFlags('PNBLACKLIST') or []
for v in d.keys():
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
+ 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_", "")
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH 2/2] base.bbclass: Restructure multilib variable cloning
2012-08-10 22:57 [PATCH 0/2] Make PNBLACKLIST work with multilibs, code cleanup Peter Seebach
2012-08-10 22:57 ` [PATCH 1/2] base.bbclass: Expand PNBLACKLIST across multilibs too Peter Seebach
@ 2012-08-10 22:58 ` Peter Seebach
2012-08-16 18:31 ` [PATCH 0/2] Make PNBLACKLIST work with multilibs, code cleanup Saul Wold
2 siblings, 0 replies; 5+ messages in thread
From: Peter Seebach @ 2012-08-10 22:58 UTC (permalink / raw)
To: openembedded-core
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
^ permalink raw reply related [flat|nested] 5+ messages in thread