Skip to contentSkip to conversation

bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type

PATCH In review Khem Raj 4 participants 4 messages Oct 22, 2010 – Oct 23, 2010

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type

It adds an override based on type of recipe
e.g. recipes ending with usual suffixes like -native -cross, -sdk add the same to overrides with out leading '-'
It also add the same override for BBCLASSEXTEND
For normal recipes we add 'target' to overrides

This will give up better control over defining and combining recipes into using BBCLASSEXTEND and still have finer control if needed. We wont require to have virtclass-xxx overrides anymore

---
 classes/utils.bbclass |    3 +++
 conf/bitbake.conf     |    2 ++
 lib/oe/utils.py       |    8 ++++++++
 3 files changed, 13 insertions(+), 0 deletions(-)
classes/utils.bbclass +3 -0
index 10d49ce..7c96509 100644
@@ -36,6 +36,9 @@ def base_both_contain(variable1, variable2, checkvalue, d):
 def base_prune_suffix(var, suffixes, d):
     return oe.utils.prune_suffix(var, suffixes, d)
 
+def base_get_suffix(var, suffixes, d):
+    return oe.utils.get_suffix(var, suffixes, d)
+
 def oe_filter(f, str, d):
     return oe.utils.str_filter(f, str, d)
 
conf/bitbake.conf +2 -0
index 539ab3d..2f3dd6b 100644
@@ -195,6 +195,8 @@ MACHINE_KERNEL_PR = ""
 # otherwise it is the same as PN and P
 SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -nativesdk -crosssdk -cross-canadian -sdk"
 BPN = "${@base_prune_suffix('${PN}', '${SPECIAL_PKGSUFFIX}'.split(), d)}"
+# Add a _target override so we can do target specific overrides when using BBCLASSEXTEND
+OVERRIDES_prepend = "${@base_get_suffix('${PN}', '${SPECIAL_PKGSUFFIX}'.split(), d)}:"
 BP = "${BPN}-${PV}"
 
 # Package info.
lib/oe/utils.py +8 -0
index 2169ed2..4822864 100644
@@ -67,6 +67,14 @@ def prune_suffix(var, suffixes, d):
             return var.replace(suffix, "")
     return var
 
+def get_suffix(var, suffixes, d):
+    # See if var ends with any of the suffixes listed and
+    # if found return it otherwise return "target'
+    for suffix in suffixes:
+        if var.endswith(suffix):
+	    return suffix[1:]
+    return "target"
+
 def str_filter(f, str, d):
     from re import match
     return " ".join(filter(lambda x: match(f, x, 0), str.split()))
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Khem Raj

It adds an override based on type of recipe
e.g. recipes ending with usual suffixes like -native -cross, -sdk add the same to overrides with out leading '-'
It also add the same override for BBCLASSEXTEND
For normal recipes we add 'target' to overrides

Quoted 6 lines

This will give up better control over defining and combining recipes into using BBCLASSEXTEND and still have finer control if needed. We wont require to have virtclass-xxx overrides anymore

As discussed on IRC:

Quoted 60 lines
---
 classes/utils.bbclass |    3 +++
 conf/bitbake.conf     |    2 ++
 lib/oe/utils.py       |    8 ++++++++
 3 files changed, 13 insertions(+), 0 deletions(-)
classes/utils.bbclass +3 -0
index 10d49ce..7c96509 100644
@@ -36,6 +36,9 @@ def base_both_contain(variable1, variable2, checkvalue, d):
 def base_prune_suffix(var, suffixes, d):
     return oe.utils.prune_suffix(var, suffixes, d)
 
+def base_get_suffix(var, suffixes, d):
+    return oe.utils.get_suffix(var, suffixes, d)
+
 def oe_filter(f, str, d):
     return oe.utils.str_filter(f, str, d)
 
conf/bitbake.conf +2 -0
index 539ab3d..2f3dd6b 100644
@@ -195,6 +195,8 @@ MACHINE_KERNEL_PR = ""
 # otherwise it is the same as PN and P
 SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -nativesdk -crosssdk -cross-canadian -sdk"
 BPN = "${@base_prune_suffix('${PN}', '${SPECIAL_PKGSUFFIX}'.split(), d)}"
+# Add a _target override so we can do target specific overrides when using BBCLASSEXTEND
+OVERRIDES_prepend = "${@base_get_suffix('${PN}', '${SPECIAL_PKGSUFFIX}'.split(), d)}:"
 BP = "${BPN}-${PV}"
 
 # Package info.
lib/oe/utils.py +8 -0
index 2169ed2..4822864 100644
@@ -67,6 +67,14 @@ def prune_suffix(var, suffixes, d):
             return var.replace(suffix, "")
     return var
 
+def get_suffix(var, suffixes, d):
+    # See if var ends with any of the suffixes listed and
+    # if found return it otherwise return "target'
+    for suffix in suffixes:
+        if var.endswith(suffix):
+	    return suffix[1:]
+    return "target"
+
 def str_filter(f, str, d):
     from re import match
     return " ".join(filter(lambda x: match(f, x, 0), str.split()))
Signature · 7 lines
1.7.1


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Acked-by on v1 1/1
#2 lore raw
In reply to Khem Raj
Quoted 6 lines · Khem Raj

It adds an override based on type of recipe
e.g. recipes ending with usual suffixes like -native -cross, -sdk add the same to overrides with out leading '-'
It also add the same override for BBCLASSEXTEND
For normal recipes we add 'target' to overrides

Quoted 7 lines

This will give up better control over defining and combining recipes into using BBCLASSEXTEND and still have finer control if needed. We wont require to have virtclass-xxx overrides anymore

This looks good, but please reword the subject text of the commit, its not very clear. Your first sentence of the more detailed information is a better summary :)

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
Acked-by on v1 1/1
#3 lore raw
In reply to Khem Raj

2010/10/22 Khem Raj <[email protected]>:

Quoted 61 lines

It adds an override based on type of recipe
e.g. recipes ending with usual suffixes like -native -cross, -sdk add the same to overrides with out leading '-'
It also add the same override for BBCLASSEXTEND
For normal recipes we add 'target' to overrides

This will give up better control over defining and combining recipes into using BBCLASSEXTEND and still have finer control if needed. We wont require to have virtclass-xxx overrides anymore

---
 classes/utils.bbclass |    3 +++
 conf/bitbake.conf     |    2 ++
 lib/oe/utils.py       |    8 ++++++++

 3 files changed, 13 insertions(+), 0 deletions(-)
classes/utils.bbclass +0 -0
index 10d49ce..7c96509 100644
@@ -36,6 +36,9 @@ def base_both_contain(variable1, variable2, checkvalue, d):

 def base_prune_suffix(var, suffixes, d):
    return oe.utils.prune_suffix(var, suffixes, d)

classes/utils.bbclass +3 -0
+def base_get_suffix(var, suffixes, d):
+    return oe.utils.get_suffix(var, suffixes, d)
+

 def oe_filter(f, str, d):
    return oe.utils.str_filter(f, str, d)

conf/bitbake.conf +0 -0
index 539ab3d..2f3dd6b 100644
@@ -195,6 +195,8 @@ MACHINE_KERNEL_PR = ""
  # otherwise it is the same as PN and P

 SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -nativesdk -crosssdk -cross-canadian -sdk" BPN = "${@base_prune_suffix('${PN}', '${SPECIAL_PKGSUFFIX}'.split(), d)}"

conf/bitbake.conf +2 -0
+# Add a _target override so we can do target specific overrides when using BBCLASSEXTEND
+OVERRIDES_prepend = "${@base_get_suffix('${PN}', '${SPECIAL_PKGSUFFIX}'.split(), d)}:"

 BP = "${BPN}-${PV}"

 # Package info.

lib/oe/utils.py +0 -0
index 2169ed2..4822864 100644
@@ -67,6 +67,14 @@ def prune_suffix(var, suffixes, d):
             return var.replace(suffix, "")

    return var

lib/oe/utils.py +8 -0
+def get_suffix(var, suffixes, d):
+    # See if var ends with any of the suffixes listed and
+    # if found return it otherwise return "target'
+    for suffix in suffixes:
+        if var.endswith(suffix):
+           return suffix[1:]
+    return "target"
+
Quoted 5 lines

 def str_filter(f, str, d):
    from re import match
    return " ".join(filter(lambda x: match(f, x, 0), str.split())) --
1.7.1

Cool. I felt we need -target for quite a while, but could not add it myself.

Next question/proposal:
A big patch to replace things like virtclass-natve to -native ? And then a patch to remove that functionality ?

Seems liek the way forward.

Frans