* [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type
@ 2010-10-22 21:39 Khem Raj
2010-10-22 22:50 ` Denys Dmytriyenko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Khem Raj @ 2010-10-22 21:39 UTC (permalink / raw)
To: openembedded-devel
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
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
classes/utils.bbclass | 3 +++
conf/bitbake.conf | 2 ++
lib/oe/utils.py | 8 ++++++++
3 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/classes/utils.bbclass b/classes/utils.bbclass
index 10d49ce..7c96509 100644
--- a/classes/utils.bbclass
+++ b/classes/utils.bbclass
@@ -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)
diff --git a/conf/bitbake.conf b/conf/bitbake.conf
index 539ab3d..2f3dd6b 100644
--- a/conf/bitbake.conf
+++ b/conf/bitbake.conf
@@ -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.
diff --git a/lib/oe/utils.py b/lib/oe/utils.py
index 2169ed2..4822864 100644
--- a/lib/oe/utils.py
+++ b/lib/oe/utils.py
@@ -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()))
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type
2010-10-22 21:39 [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type Khem Raj
@ 2010-10-22 22:50 ` Denys Dmytriyenko
2010-10-22 22:52 ` Chris Larson
2010-10-23 7:18 ` Frans Meulenbroeks
2 siblings, 0 replies; 4+ messages in thread
From: Denys Dmytriyenko @ 2010-10-22 22:50 UTC (permalink / raw)
To: openembedded-devel
On Fri, Oct 22, 2010 at 02:39:27PM -0700, Khem Raj wrote:
> 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
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
As discussed on IRC:
Acked-by: Denys Dmytriyenko <denis@denix.org>
> ---
> classes/utils.bbclass | 3 +++
> conf/bitbake.conf | 2 ++
> lib/oe/utils.py | 8 ++++++++
> 3 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/classes/utils.bbclass b/classes/utils.bbclass
> index 10d49ce..7c96509 100644
> --- a/classes/utils.bbclass
> +++ b/classes/utils.bbclass
> @@ -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)
>
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index 539ab3d..2f3dd6b 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -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.
> diff --git a/lib/oe/utils.py b/lib/oe/utils.py
> index 2169ed2..4822864 100644
> --- a/lib/oe/utils.py
> +++ b/lib/oe/utils.py
> @@ -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()))
> --
> 1.7.1
>
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type
2010-10-22 21:39 [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type Khem Raj
2010-10-22 22:50 ` Denys Dmytriyenko
@ 2010-10-22 22:52 ` Chris Larson
2010-10-23 7:18 ` Frans Meulenbroeks
2 siblings, 0 replies; 4+ messages in thread
From: Chris Larson @ 2010-10-22 22:52 UTC (permalink / raw)
To: openembedded-devel
On Fri, Oct 22, 2010 at 2:39 PM, Khem Raj <raj.khem@gmail.com> wrote:
> 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
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>
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 :)
Acked-by: Chris Larson <chris_larson@mentor.com>
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type
2010-10-22 21:39 [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type Khem Raj
2010-10-22 22:50 ` Denys Dmytriyenko
2010-10-22 22:52 ` Chris Larson
@ 2010-10-23 7:18 ` Frans Meulenbroeks
2 siblings, 0 replies; 4+ messages in thread
From: Frans Meulenbroeks @ 2010-10-23 7:18 UTC (permalink / raw)
To: openembedded-devel
2010/10/22 Khem Raj <raj.khem@gmail.com>:
> 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
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> classes/utils.bbclass | 3 +++
> conf/bitbake.conf | 2 ++
> lib/oe/utils.py | 8 ++++++++
> 3 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/classes/utils.bbclass b/classes/utils.bbclass
> index 10d49ce..7c96509 100644
> --- a/classes/utils.bbclass
> +++ b/classes/utils.bbclass
> @@ -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)
>
> diff --git a/conf/bitbake.conf b/conf/bitbake.conf
> index 539ab3d..2f3dd6b 100644
> --- a/conf/bitbake.conf
> +++ b/conf/bitbake.conf
> @@ -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.
> diff --git a/lib/oe/utils.py b/lib/oe/utils.py
> index 2169ed2..4822864 100644
> --- a/lib/oe/utils.py
> +++ b/lib/oe/utils.py
> @@ -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()))
> --
> 1.7.1
Cool. I felt we need -target for quite a while, but could not add it myself.
Acked-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-23 7:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22 21:39 [PATCH] bitbake.conf: Add one recipe identifying OVERRIDE based on recipe type Khem Raj
2010-10-22 22:50 ` Denys Dmytriyenko
2010-10-22 22:52 ` Chris Larson
2010-10-23 7:18 ` Frans Meulenbroeks
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.